Enable golangci linter contextcheck (#3170)

Split out from https://github.com/woodpecker-ci/woodpecker/pull/2960
This commit is contained in:
Robert Kaussow
2024-01-11 22:15:15 +01:00
committed by GitHub
parent d0380e31b5
commit f813badcf9
10 changed files with 32 additions and 35 deletions

View File

@@ -133,12 +133,13 @@ func (r *Runner) Run(runnerCtx context.Context) error {
state := rpc.State{}
state.Started = time.Now().Unix()
err = r.client.Init(ctxmeta, work.ID, state)
err = r.client.Init(runnerCtx, work.ID, state)
if err != nil {
logger.Error().Err(err).Msg("pipeline initialization failed")
}
var uploads sync.WaitGroup
//nolint:contextcheck
err = pipeline.New(work.Config,
pipeline.WithContext(workflowCtx),
pipeline.WithTaskUUID(fmt.Sprint(work.ID)),
@@ -188,7 +189,7 @@ func (r *Runner) Run(runnerCtx context.Context) error {
Int("exit_code", state.ExitCode).
Msg("updating pipeline status")
if err := r.client.Done(ctxmeta, work.ID, state); err != nil {
if err := r.client.Done(runnerCtx, work.ID, state); err != nil {
logger.Error().Err(err).Msg("updating pipeline status failed")
} else {
logger.Debug().Msg("updating pipeline status complete")