X Tutup
Skip to content

Commit eb5d0e9

Browse files
authored
Update golangci-lint from v1.29.0 to v1.42.1 (letsencrypt#5745)
Update the version of golangci-lint we use in our docker image, and update the version of the docker image we use in our tests. Fix a couple places where we were violating lints (ineffective assign and calling `t.Fatal` from outside the main test goroutine), and add one lint (using math/rand) to the ignore list. Fixes letsencrypt#5710
1 parent 011e453 commit eb5d0e9

19 files changed

+28
-29
lines changed

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ issues:
2525
# G401: Use of weak cryptographic primitive
2626
# G402: TLS InsecureSkipVerify set true.
2727
# G403: RSA keys should be at least 2048 bits
28+
# G404: Use of weak random number generator (math/rand instead of crypto/rand)
2829
# G501: Blacklisted import `crypto/md5`: weak cryptographic primitive
2930
# G505: Blacklisted import `crypto/sha1`: weak cryptographic primitive
30-
text: "G(101|102|107|201|202|306|401|402|403|501|505)"
31+
text: "G(101|102|107|201|202|306|401|402|403|404|501|505)"
3132
- linters:
3233
- staticcheck
3334
text: "(SA1019|ST1005|ST1013|SA6003|SA5011|S1029|SA2002):"

cmd/bad-key-revoker/main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ func TestSelectUncheckedRows(t *testing.T) {
6161

6262
hashA, hashB, hashC := randHash(t), randHash(t), randHash(t)
6363
insertBlockedRow(t, dbMap, fc, hashA, 1, true)
64-
row, err := bkr.selectUncheckedKey()
64+
_, err = bkr.selectUncheckedKey()
6565
test.AssertError(t, err, "selectUncheckedKey didn't fail with no rows to process")
6666
test.Assert(t, db.IsNoRows(err), "returned error is not sql.ErrNoRows")
6767
insertBlockedRow(t, dbMap, fc, hashB, 1, false)
6868
insertBlockedRow(t, dbMap, fc, hashC, 1, false)
69-
row, err = bkr.selectUncheckedKey()
69+
row, err := bkr.selectUncheckedKey()
7070
test.AssertNotError(t, err, "selectUncheckKey failed")
7171
test.AssertByteEquals(t, row.KeyHash, hashB)
7272
test.AssertEquals(t, row.RevokedBy, int64(1))

cmd/clock_generic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !integration
1+
//go:build !integration
22

33
package cmd
44

cmd/clock_integration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build integration
1+
//go:build integration
22

33
package cmd
44

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
boulder:
4-
image: &boulder_image letsencrypt/boulder-tools:${BOULDER_TOOLS_TAG:-go1.17_2021-08-26}
4+
image: &boulder_image letsencrypt/boulder-tools:${BOULDER_TOOLS_TAG:-go1.17_2021-10-22}
55
environment:
66
FAKE_DNS: 10.77.77.77
77
BOULDER_CONFIG_DIR: test/config

grpc/interceptors_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ func TestTimeouts(t *testing.T) {
156156
test_proto.RegisterChillerServer(s, &testServer{})
157157
go func() {
158158
start := time.Now()
159-
if err := s.Serve(lis); err != nil &&
160-
!strings.HasSuffix(err.Error(), "use of closed network connection") {
161-
t.Fatalf("s.Serve: %v after %s", err, time.Since(start))
159+
err := s.Serve(lis)
160+
if err != nil && !strings.HasSuffix(err.Error(), "use of closed network connection") {
161+
t.Logf("s.Serve: %v after %s", err, time.Since(start))
162162
}
163163
}()
164164
defer s.Stop()
@@ -218,9 +218,9 @@ func TestRequestTimeTagging(t *testing.T) {
218218
// Chill until ill
219219
go func() {
220220
start := time.Now()
221-
if err := s.Serve(lis); err != nil &&
222-
!strings.HasSuffix(err.Error(), "use of closed network connection") {
223-
t.Fatalf("s.Serve: %v after %s", err, time.Since(start))
221+
err := s.Serve(lis)
222+
if err != nil && !strings.HasSuffix(err.Error(), "use of closed network connection") {
223+
t.Logf("s.Serve: %v after %s", err, time.Since(start))
224224
}
225225
}()
226226
defer s.Stop()
@@ -303,9 +303,9 @@ func TestInFlightRPCStat(t *testing.T) {
303303
// Chill until ill
304304
go func() {
305305
start := time.Now()
306-
if err := s.Serve(lis); err != nil &&
307-
!strings.HasSuffix(err.Error(), "use of closed network connection") {
308-
t.Fatalf("s.Serve: %v after %s", err, time.Since(start))
306+
err := s.Serve(lis)
307+
if err != nil && !strings.HasSuffix(err.Error(), "use of closed network connection") {
308+
t.Logf("s.Serve: %v after %s", err, time.Since(start))
309309
}
310310
}()
311311
defer s.Stop()

test/boulder-tools/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ unzip /tmp/protoc.zip -d /usr/local/protoc
3131
export GOBIN=/usr/local/bin GOCACHE=/tmp/gocache
3232

3333
# Install golangci-lint
34-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOBIN v1.29.0
34+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOBIN v1.42.1
3535

3636
# Install protobuf and testing/dev tools.
3737
# Note: The version of golang/protobuf is partially tied to the version of grpc

test/integration/akamai_purger_drain_queue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build integration
1+
//go:build integration
22

33
package integration
44

test/integration/authz_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build integration
1+
//go:build integration
22

33
package integration
44

test/integration/caa_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build integration
1+
//go:build integration
22

33
package integration
44

0 commit comments

Comments
 (0)
X Tutup