Skip to content

Commit

Permalink
Update golangci-lint to 1.59.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hypnoglow committed Jul 4, 2024
1 parent f74123e commit a91cad7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ jobs:
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5

- name: Run linters
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
with:
version: v1.48
version: v1.59.1
args: --verbose
# See: https://github.com/golangci/golangci-lint-action/issues/244
skip-pkg-cache: true
skip-build-cache: true

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
Expand Down
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ linters:
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exhaustive
Expand Down Expand Up @@ -39,13 +37,11 @@ linters:
- rowserrcheck
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace

linters-settings:
Expand All @@ -67,3 +63,7 @@ issues:
- linters:
- staticcheck
text: "strings.Title has been deprecated"
# TODO: fix this later.
- linters:
- revive
text: "^unused-parameter"
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
golang 1.22.5
helm 3.13.2
golangci-lint 1.48.0
golangci-lint 1.59.1
goreleaser 2.0.1
10 changes: 5 additions & 5 deletions internal/awss3/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (s *Storage) Traverse(ctx context.Context, repoURI string) (<-chan ChartInf
// traverse traverses all charts in the repository.
// It writes an info item about every chart to items, and errors to errs.
// It always closes both channels when returns.
func (s *Storage) traverse(ctx context.Context, repoURI string, items chan<- ChartInfo, errs chan<- error) { //nolint:unparam // TODO: fix this issue.
func (s *Storage) traverse(ctx context.Context, repoURI string, items chan<- ChartInfo, errs chan<- error) {
defer close(items)
defer close(errs)

Expand All @@ -80,7 +80,7 @@ func (s *Storage) traverse(ctx context.Context, repoURI string, items chan<- Cha

var continuationToken *string
for {
listOut, err := client.ListObjectsV2(&s3.ListObjectsV2Input{
listOut, err := client.ListObjectsV2WithContext(ctx, &s3.ListObjectsV2Input{
Bucket: aws.String(bucket),
Prefix: aws.String(prefixKey),
ContinuationToken: continuationToken,
Expand Down Expand Up @@ -110,7 +110,7 @@ func (s *Storage) traverse(ctx context.Context, repoURI string, items chan<- Cha
continue
}

metaOut, err := client.HeadObject(&s3.HeadObjectInput{
metaOut, err := client.HeadObjectWithContext(ctx, &s3.HeadObjectInput{
Bucket: aws.String(bucket),
Key: obj.Key,
})
Expand All @@ -134,7 +134,7 @@ func (s *Storage) traverse(ctx context.Context, repoURI string, items chan<- Cha
// https://github.com/hypnoglow/helm-s3/issues/112 )
//
// In this case we have to download the ch file itself.
objectOut, err := client.GetObject(&s3.GetObjectInput{
objectOut, err := client.GetObjectWithContext(ctx, &s3.GetObjectInput{
Bucket: aws.String(bucket),
Key: obj.Key,
})
Expand Down Expand Up @@ -229,7 +229,7 @@ func (s *Storage) Exists(ctx context.Context, uri string) (bool, error) {
return false, err
}

_, err = s3.New(s.session).HeadObject(&s3.HeadObjectInput{
_, err = s3.New(s.session).HeadObjectWithContext(ctx, &s3.HeadObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(key),
})
Expand Down

0 comments on commit a91cad7

Please sign in to comment.