diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 8d95dc21c4..4186c160c8 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,5 +19,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.45.2 + version: v1.47.3 working-directory: ${{matrix.working-directory}} diff --git a/pkg/client/apiutil/dynamicrestmapper.go b/pkg/client/apiutil/dynamicrestmapper.go index e6cc51c6e9..c26a285d79 100644 --- a/pkg/client/apiutil/dynamicrestmapper.go +++ b/pkg/client/apiutil/dynamicrestmapper.go @@ -167,7 +167,7 @@ func (drm *dynamicRESTMapper) checkAndReload(needsReloadErr error, checkNeedsRel // NB(directxman12): `Is` and `As` have a confusing relationship -- // `Is` is like `== or does this implement .Is`, whereas `As` says // `can I type-assert into` - needsReload := errors.As(err, &needsReloadErr) + needsReload := errors.As(err, needsReloadErr) if !needsReload { return err } @@ -178,7 +178,7 @@ func (drm *dynamicRESTMapper) checkAndReload(needsReloadErr error, checkNeedsRel // ... and double-check that we didn't reload in the meantime err = checkNeedsReload() - needsReload = errors.As(err, &needsReloadErr) + needsReload = errors.As(err, needsReloadErr) if !needsReload { return err } diff --git a/pkg/internal/testing/process/process.go b/pkg/internal/testing/process/process.go index c721ba01af..af83c70a2f 100644 --- a/pkg/internal/testing/process/process.go +++ b/pkg/internal/testing/process/process.go @@ -184,16 +184,12 @@ func (ps *State) Start(stdout, stderr io.Writer) (err error) { ps.ready = true return nil case <-ps.waitDone: - if pollerStopCh != nil { - close(pollerStopCh) - } + close(pollerStopCh) return fmt.Errorf("timeout waiting for process %s to start successfully "+ "(it may have failed to start, or stopped unexpectedly before becoming ready)", path.Base(ps.Path)) case <-timedOut: - if pollerStopCh != nil { - close(pollerStopCh) - } + close(pollerStopCh) if ps.Cmd != nil { // intentionally ignore this -- we might've crashed, failed to start, etc ps.Cmd.Process.Signal(syscall.SIGTERM) //nolint:errcheck