style: fix golangci-lint errors

This commit is contained in:
张泊明518370910136 2024-03-04 01:06:23 -05:00
parent 5d6bf8c5cd
commit 1f20aa3105
GPG Key ID: D47306D7062CDA9D
3 changed files with 8 additions and 3 deletions

View File

@ -43,9 +43,12 @@ func (e *Sandbox) Run(cmd stage.Cmd) (*stage.Result, error) {
func (e *Sandbox) Cleanup() error {
slog.Info("sandbox cleanup")
for _, fileID := range e.cachedMap {
e.execClient.FileDelete(context.TODO(), &pb.FileID{
_, err := e.execClient.FileDelete(context.TODO(), &pb.FileID{
FileID: fileID,
})
if err != nil {
slog.Error("sandbox cleanup", "error", err)
}
}
return nil
}

View File

@ -115,7 +115,6 @@ type Result struct {
FileIDs map[string]string `json:"fileIds,omitempty"`
FileError []FileError `json:"fileError,omitempty"`
files []string
Buffs map[string][]byte `json:"-"`
}

View File

@ -55,6 +55,9 @@ func Run(stages []Stage) []StageResult {
func Cleanup() {
for _, executor := range executorMap {
executor.Cleanup()
err := executor.Cleanup()
if err != nil {
slog.Error("executor cleanup error", "error", err)
}
}
}