Skip to content

Commit

Permalink
Update golangci-lint to 1.47.3
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaroaleman committed Aug 11, 2022
1 parent bcde6f0 commit 1f457a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
4 changes: 3 additions & 1 deletion pkg/certwatcher/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"crypto/tls"
"net/http"
"time"

ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/certwatcher"
Expand Down Expand Up @@ -56,7 +57,8 @@ func Example() {

// Initialize your tls server
srv := &http.Server{
Handler: &sampleServer{},
Handler: &sampleServer{},
ReadHeaderTimeout: 5 * time.Second,
}

// Start goroutine for handling server shutdown.
Expand Down
7 changes: 2 additions & 5 deletions pkg/client/apiutil/dynamicrestmapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ func (drm *dynamicRESTMapper) checkAndReload(needsReloadErr error, checkNeedsRel
return checkNeedsReload()
}()

// 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.Is(err, needsReloadErr)
if !needsReload {
return err
}
Expand All @@ -178,7 +175,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.Is(err, needsReloadErr)
if !needsReload {
return err
}
Expand Down
8 changes: 2 additions & 6 deletions pkg/internal/testing/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f457a1

Please sign in to comment.