Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
- uses: actions/checkout@v4

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: v1.63.4
version: v2.0.2
62 changes: 49 additions & 13 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,50 @@
run:
timeout: 5m

issues:
exclude-files:
- '(.+)_test\.go'

version: "2"
linters:
disable-all: false
presets:
- bugs
- unused
# - style
fast: false
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- durationcheck
- errchkjson
- errorlint
- exhaustive
- gocheckcompilerdirectives
- gochecksumtype
- gosec
- gosmopolitan
- loggercheck
- makezero
- musttag
- nilerr
- nilnesserr
- noctx
- protogetter
- reassign
- recvcheck
- rowserrcheck
- spancheck
- sqlclosecheck
- testifylint
- unparam
- zerologlint
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- (.+)_test\.go
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion cmd/cloudfront.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var cloudfrontCmd = &cobra.Command{
for _, distribution := range distributions {
var val string

if *distribution.Distribution.DistributionConfig.Enabled == false {
if !*distribution.Distribution.DistributionConfig.Enabled {
val = "disabled"
rc = 2
totalCrit++
Expand Down
2 changes: 1 addition & 1 deletion cmd/ec2_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var ec2InstancesCmd = &cobra.Command{
summary += fmt.Sprintf(" %d %s ", count, state)
ctr += count
if ctr != len(instances.Instances) {
summary += fmt.Sprintf("-")
summary += "-"
}
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/s3_buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var s3BucketCmd = &cobra.Command{
}

if len(buckets.Buckets) == 0 {
check.ExitError(fmt.Errorf("No buckets available"))
check.ExitError(fmt.Errorf("no buckets available"))
}

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

output += objectsOutput.GetBucketOutput(bucketSize, rc)

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

Expand Down
2 changes: 1 addition & 1 deletion cmd/s3_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var s3ObjectCmd = &cobra.Command{
}

if len(buckets.Buckets) == 0 {
check.ExitError(fmt.Errorf("No buckets available"))
check.ExitError(fmt.Errorf("no buckets available"))
}

critical, err := internal.ParseThreshold(CriticalObjectSize)
Expand Down
4 changes: 2 additions & 2 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var statusCmd = &cobra.Command{
c := &http.Client{}

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

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

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

defer resp.Body.Close()
Expand Down
2 changes: 1 addition & 1 deletion internal/s3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/aws/aws-sdk-go/service/s3"
)

var ErrBucketNotFound = errors.New("No such Bucket")
var ErrBucketNotFound = errors.New("no such Bucket")

type S3Client struct {
S3Client *s3.S3
Expand Down