Skip to content

Commit a23ddec

Browse files
Merge pull request #259 from NETWAYS/dependabot/github_actions/golangci/golangci-lint-action-7
Bump golangci/golangci-lint-action from 6 to 7
2 parents 1e30f71 + 886567f commit a23ddec

File tree

8 files changed

+59
-23
lines changed

8 files changed

+59
-23
lines changed

.github/workflows/golangci-lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
- uses: actions/checkout@v4
1616

1717
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v6
18+
uses: golangci/golangci-lint-action@v7
1919
with:
20-
version: v1.63.4
20+
version: v2.0.2

.golangci.yml

+49-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,50 @@
1-
run:
2-
timeout: 5m
3-
4-
issues:
5-
exclude-files:
6-
- '(.+)_test\.go'
7-
1+
version: "2"
82
linters:
9-
disable-all: false
10-
presets:
11-
- bugs
12-
- unused
13-
# - style
14-
fast: false
3+
enable:
4+
- asasalint
5+
- asciicheck
6+
- bidichk
7+
- bodyclose
8+
- contextcheck
9+
- durationcheck
10+
- errchkjson
11+
- errorlint
12+
- exhaustive
13+
- gocheckcompilerdirectives
14+
- gochecksumtype
15+
- gosec
16+
- gosmopolitan
17+
- loggercheck
18+
- makezero
19+
- musttag
20+
- nilerr
21+
- nilnesserr
22+
- noctx
23+
- protogetter
24+
- reassign
25+
- recvcheck
26+
- rowserrcheck
27+
- spancheck
28+
- sqlclosecheck
29+
- testifylint
30+
- unparam
31+
- zerologlint
32+
exclusions:
33+
generated: lax
34+
presets:
35+
- comments
36+
- common-false-positives
37+
- legacy
38+
- std-error-handling
39+
paths:
40+
- (.+)_test\.go
41+
- third_party$
42+
- builtin$
43+
- examples$
44+
formatters:
45+
exclusions:
46+
generated: lax
47+
paths:
48+
- third_party$
49+
- builtin$
50+
- examples$

cmd/cloudfront.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var cloudfrontCmd = &cobra.Command{
6363
for _, distribution := range distributions {
6464
var val string
6565

66-
if *distribution.Distribution.DistributionConfig.Enabled == false {
66+
if !*distribution.Distribution.DistributionConfig.Enabled {
6767
val = "disabled"
6868
rc = 2
6969
totalCrit++

cmd/ec2_instances.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var ec2InstancesCmd = &cobra.Command{
5050
summary += fmt.Sprintf(" %d %s ", count, state)
5151
ctr += count
5252
if ctr != len(instances.Instances) {
53-
summary += fmt.Sprintf("-")
53+
summary += "-"
5454
}
5555
}
5656

cmd/s3_buckets.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ var s3BucketCmd = &cobra.Command{
7878
}
7979

8080
if len(buckets.Buckets) == 0 {
81-
check.ExitError(fmt.Errorf("No buckets available"))
81+
check.ExitError(fmt.Errorf("no buckets available"))
8282
}
8383

8484
critical, err := internal.ParseThreshold(CriticalBucketSize)
@@ -124,7 +124,7 @@ var s3BucketCmd = &cobra.Command{
124124

125125
output += objectsOutput.GetBucketOutput(bucketSize, rc)
126126

127-
if len(buckets.Buckets) > 1 && !(len(buckets.Buckets) == idx+1) {
127+
if len(buckets.Buckets) > 1 && (len(buckets.Buckets) != idx+1) {
128128
output += "\n"
129129
}
130130

cmd/s3_objects.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var s3ObjectCmd = &cobra.Command{
8989
}
9090

9191
if len(buckets.Buckets) == 0 {
92-
check.ExitError(fmt.Errorf("No buckets available"))
92+
check.ExitError(fmt.Errorf("no buckets available"))
9393
}
9494

9595
critical, err := internal.ParseThreshold(CriticalObjectSize)

cmd/status.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ var statusCmd = &cobra.Command{
9696
c := &http.Client{}
9797

9898
if Region == "" && !contains(cliStatusConfig.Service, globalServices) {
99-
check.ExitError(fmt.Errorf("Region required for regional services"))
99+
check.ExitError(fmt.Errorf("region required for regional services"))
100100
}
101101

102102
// Using + concatenation since the JoinPath will add / inbetween
@@ -115,7 +115,7 @@ var statusCmd = &cobra.Command{
115115
}
116116

117117
if resp.StatusCode != http.StatusOK {
118-
check.ExitError(fmt.Errorf("Could not get %s - Error: %d", feedUrl, resp.StatusCode))
118+
check.ExitError(fmt.Errorf("could not get %s - Error: %d", feedUrl, resp.StatusCode))
119119
}
120120

121121
defer resp.Body.Close()

internal/s3/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/aws/aws-sdk-go/service/s3"
99
)
1010

11-
var ErrBucketNotFound = errors.New("No such Bucket")
11+
var ErrBucketNotFound = errors.New("no such Bucket")
1212

1313
type S3Client struct {
1414
S3Client *s3.S3

0 commit comments

Comments
 (0)