Skip to content

Commit

Permalink
Update exec.go
Browse files Browse the repository at this point in the history
  • Loading branch information
claire1618 authored Aug 25, 2023
1 parent 142c312 commit f490420
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/vela-worker/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ func (w *Worker) exec(index int, config *library.Worker) error {
return err
}

// set up build executable
execBuildExecutable, resp, err := execBuildClient.Build.GetBuildExecutable(item.Repo.GetOrg(), item.Repo.GetName(), item.Build.GetNumber())

Check failure on line 66 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L66

SA4006: this value of `resp` is never used (staticcheck)
Raw output
cmd/vela-worker/exec.go:66:2: SA4006: this value of `resp` is never used (staticcheck)
	execBuildExecutable, resp, err := execBuildClient.Build.GetBuildExecutable(item.Repo.GetOrg(), item.Repo.GetName(), item.Build.GetNumber())
	^
if err != nil {
return err
}

var execBuildExecutablePipeline pipeline.Build
err = json.Unmarshal([]byte(execBuildExecutable.GetData()), &execBuildExecutablePipeline)
// get the build pipeline from the build executable
pipeline := new(pipeline.Build)
err = json.Unmarshal((execBuildExecutable.GetData()), pipeline)
if err != nil {

Check failure on line 74 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L74

only one cuddle assignment allowed before if statement (wsl)
Raw output
cmd/vela-worker/exec.go:74:2: only one cuddle assignment allowed before if statement (wsl)
	if err != nil {
	^
return err
}
Expand Down Expand Up @@ -162,7 +164,7 @@ func (w *Worker) exec(index int, config *library.Worker) error {
Hostname: w.Config.API.Address.Hostname(),
Runtime: w.Runtime,
Build: item.Build,
Pipeline: &execBuildExecutablePipeline,
Pipeline: pipeline.Sanitize(w.Config.Runtime.Driver),
Repo: item.Repo,
User: item.User,
Version: v.Semantic(),
Expand Down

0 comments on commit f490420

Please sign in to comment.