style: fix golangci-lint errors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
张泊明518370910136 2024-03-05 01:47:56 -05:00
parent c34ed3aa83
commit e128f2eea8
GPG Key ID: D47306D7062CDA9D
2 changed files with 5 additions and 12 deletions

View File

@ -49,7 +49,11 @@ func generateStages(conf Conf) []stage.Stage {
var cmds []stage.Cmd var cmds []stage.Cmd
for _, optionalCmd := range s.Executor.With.Cases { for _, optionalCmd := range s.Executor.With.Cases {
cmd := s.Executor.With.Default cmd := s.Executor.With.Default
copier.Copy(&cmd, &optionalCmd) err := copier.Copy(&cmd, &optionalCmd)
if err != nil {
slog.Error("generate stages", "error", err)
os.Exit(1)
}
cmds = append(cmds, cmd) cmds = append(cmds, cmd)
} }
if len(s.Executor.With.Cases) == 0 { if len(s.Executor.With.Cases) == 0 {

View File

@ -129,17 +129,6 @@ func convertPBFile(i stage.CmdFile) *pb.Request_File {
return nil return nil
} }
func convertAbsPath(cmdFile *stage.CmdFile) error {
if cmdFile.Src != nil && !filepath.IsAbs(*cmdFile.Src) {
absPath, err := filepath.Abs(*cmdFile.Src)
if err != nil {
return err
}
cmdFile.Src = &absPath
}
return nil
}
func convertPBResult(res []*pb.Response_Result) []stage.ExecutorResult { func convertPBResult(res []*pb.Response_Result) []stage.ExecutorResult {
var ret []stage.ExecutorResult var ret []stage.ExecutorResult
for _, r := range res { for _, r := range res {