Skip to content

Commit 1f457a1

Browse files
committed
Update golangci-lint to 1.47.3
1 parent bcde6f0 commit 1f457a1

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ jobs:
1919
- name: golangci-lint
2020
uses: golangci/golangci-lint-action@v2
2121
with:
22-
version: v1.45.2
22+
version: v1.47.3
2323
working-directory: ${{matrix.working-directory}}

pkg/certwatcher/example_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"crypto/tls"
2222
"net/http"
23+
"time"
2324

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

5758
// Initialize your tls server
5859
srv := &http.Server{
59-
Handler: &sampleServer{},
60+
Handler: &sampleServer{},
61+
ReadHeaderTimeout: 5 * time.Second,
6062
}
6163

6264
// Start goroutine for handling server shutdown.

pkg/client/apiutil/dynamicrestmapper.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,7 @@ func (drm *dynamicRESTMapper) checkAndReload(needsReloadErr error, checkNeedsRel
164164
return checkNeedsReload()
165165
}()
166166

167-
// NB(directxman12): `Is` and `As` have a confusing relationship --
168-
// `Is` is like `== or does this implement .Is`, whereas `As` says
169-
// `can I type-assert into`
170-
needsReload := errors.As(err, &needsReloadErr)
167+
needsReload := errors.Is(err, needsReloadErr)
171168
if !needsReload {
172169
return err
173170
}
@@ -178,7 +175,7 @@ func (drm *dynamicRESTMapper) checkAndReload(needsReloadErr error, checkNeedsRel
178175

179176
// ... and double-check that we didn't reload in the meantime
180177
err = checkNeedsReload()
181-
needsReload = errors.As(err, &needsReloadErr)
178+
needsReload = errors.Is(err, needsReloadErr)
182179
if !needsReload {
183180
return err
184181
}

pkg/internal/testing/process/process.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,12 @@ func (ps *State) Start(stdout, stderr io.Writer) (err error) {
184184
ps.ready = true
185185
return nil
186186
case <-ps.waitDone:
187-
if pollerStopCh != nil {
188-
close(pollerStopCh)
189-
}
187+
close(pollerStopCh)
190188
return fmt.Errorf("timeout waiting for process %s to start successfully "+
191189
"(it may have failed to start, or stopped unexpectedly before becoming ready)",
192190
path.Base(ps.Path))
193191
case <-timedOut:
194-
if pollerStopCh != nil {
195-
close(pollerStopCh)
196-
}
192+
close(pollerStopCh)
197193
if ps.Cmd != nil {
198194
// intentionally ignore this -- we might've crashed, failed to start, etc
199195
ps.Cmd.Process.Signal(syscall.SIGTERM) //nolint:errcheck

0 commit comments

Comments
 (0)