Skip to content

Commit c4aa21f

Browse files
committed
tools+golangci: update linter
1 parent 3a25952 commit c4aa21f

13 files changed

+421
-472
lines changed

.golangci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
run:
22
# timeout for analysis
3-
deadline: 4m
3+
timeout: 4m
44

55
# Linting uses a lot of memory. Keep it under control by only running a single
66
# worker.
77
concurrency: 1
88

99
linters-settings:
10-
govet:
11-
# Don't report about shadowed variables
12-
check-shadowing: false
1310
gofmt:
1411
# simplify code: gofmt with `-s` option, true by default
1512
simplify: true
@@ -20,15 +17,14 @@ linters:
2017
# the latest linter includes many sub-linters which do not pass the codebase.
2118
enable:
2219
- bodyclose
20+
- copyloopvar
2321
- dupl
2422
- errcheck
25-
- exportloopref
2623
- goconst
2724
- gocritic
2825
- gocyclo
2926
- gofmt
3027
- goimports
31-
- golint
3228
- gosimple
3329
- govet
3430
- ineffassign

aperture.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (a *Aperture) Start(errChan chan error) error {
202202

203203
// Enable http profiling and validate profile port number if requested.
204204
if a.cfg.Profile != 0 {
205-
if a.cfg.Profile < 1024 || a.cfg.Profile > 65535 {
205+
if a.cfg.Profile < 1024 {
206206
return fmt.Errorf("the profile port must be between " +
207207
"1024 and 65535")
208208
}

config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ var (
1818
defaultTLSCertFilename = "tls.cert"
1919
defaultLogLevel = "info"
2020
defaultLogFilename = "aperture.log"
21-
defaultMaxLogFiles = 3
22-
defaultMaxLogFileSize = 10
2321
defaultInvoiceBatchSize = 100000
2422

2523
defaultSqliteDatabaseFileName = "aperture.db"

hashmail_server_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ func TestStaleMailboxCleanup(t *testing.T) {
307307
}
308308

309309
for _, test := range tests {
310-
test := test
311310
t.Run(test.name, func(t *testing.T) {
312311
ctx := context.Background()
313312

l402/caveat_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func TestCaveatSerialization(t *testing.T) {
3939
}
4040

4141
for _, test := range tests {
42-
test := test
4342
success := t.Run(test.name, func(t *testing.T) {
4443
caveat, err := DecodeCaveat(test.caveatStr)
4544
if !errors.Is(err, test.err) {
@@ -185,7 +184,6 @@ func TestVerifyCaveats(t *testing.T) {
185184
}
186185

187186
for _, test := range tests {
188-
test := test
189187
success := t.Run(test.name, func(t *testing.T) {
190188
err := VerifyCaveats(test.caveats, test.satisfiers...)
191189
if test.shouldFail && err == nil {

l402/client_interceptor_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ func TestUnaryInterceptor(t *testing.T) {
282282

283283
// Run through the test cases.
284284
for _, tc := range testCases {
285-
tc := tc
286285
intercept := func() error {
287286
return tc.interceptor.UnaryInterceptor(
288287
ctx, "", nil, nil, nil, unaryInvoker, nil,
@@ -314,7 +313,6 @@ func TestStreamInterceptor(t *testing.T) {
314313

315314
// Run through the test cases.
316315
for _, tc := range testCases {
317-
tc := tc
318316
intercept := func() error {
319317
_, err := tc.interceptor.StreamInterceptor(
320318
ctx, nil, nil, "", streamInvoker,

l402/identifier_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ func TestIdentifierSerialization(t *testing.T) {
4444
}
4545

4646
for _, test := range tests {
47-
test := test
4847
success := t.Run(test.name, func(t *testing.T) {
4948
var buf bytes.Buffer
5049
err := EncodeIdentifier(&buf, &test.id)

l402/satisfier_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func TestTimeoutSatisfier(t *testing.T) {
5454
)
5555

5656
for _, test := range tests {
57-
test := test
5857
t.Run(test.name, func(t *testing.T) {
5958
var prev *Caveat
6059
for _, timeout := range test.timeouts {

l402/service_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ func TestServicesCaveatSerialization(t *testing.T) {
5858
}
5959

6060
for _, test := range tests {
61-
test := test
6261
success := t.Run(test.name, func(t *testing.T) {
6362
services, err := decodeServicesCaveatValue(test.value)
6463
if !errors.Is(err, test.err) {

proxy/proxy_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ func TestProxyHTTP(t *testing.T) {
101101
}}
102102

103103
for _, tc := range testCases {
104-
tc := tc
105-
106104
t.Run(tc.name+" GET", func(t *testing.T) {
107105
runHTTPTest(t, tc, "GET")
108106
})
@@ -236,8 +234,6 @@ func TestProxyGRPC(t *testing.T) {
236234
}}
237235

238236
for _, tc := range testCases {
239-
tc := tc
240-
241237
t.Run(tc.name, func(t *testing.T) {
242238
runGRPCTest(t, tc)
243239
})

0 commit comments

Comments
 (0)