From e128f2eea8aefad39c13f06489638e9ac5cea81c Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Tue, 5 Mar 2024 01:47:56 -0500 Subject: [PATCH] style: fix golangci-lint errors --- cmd/joj3/main.go | 6 +++++- internal/executors/sandbox/convert.go | 11 ----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/cmd/joj3/main.go b/cmd/joj3/main.go index 88ef7ec..8e68b62 100644 --- a/cmd/joj3/main.go +++ b/cmd/joj3/main.go @@ -49,7 +49,11 @@ func generateStages(conf Conf) []stage.Stage { var cmds []stage.Cmd for _, optionalCmd := range s.Executor.With.Cases { 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) } if len(s.Executor.With.Cases) == 0 { diff --git a/internal/executors/sandbox/convert.go b/internal/executors/sandbox/convert.go index 9798602..b61fe0e 100644 --- a/internal/executors/sandbox/convert.go +++ b/internal/executors/sandbox/convert.go @@ -129,17 +129,6 @@ func convertPBFile(i stage.CmdFile) *pb.Request_File { 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 { var ret []stage.ExecutorResult for _, r := range res {