Skip to content

Commit 4986ce2

Browse files
committed
feat: Update the GolangCi-lint version
1 parent ec3e2c9 commit 4986ce2

File tree

14 files changed

+49
-34
lines changed

14 files changed

+49
-34
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/setup-go@v5
1414
with:
1515
go-version-file: go.mod
16-
- uses: golangci/golangci-lint-action@v6
16+
- uses: golangci/golangci-lint-action@v9
1717
- name: Unit Tests (Windows)
1818
if: runner.os == 'Windows'
1919
run: ./bin/test-unit.ps1

.golangci.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
# https://golangci-lint.run/usage/configuration/
2-
run:
3-
timeout: 5m # 1m default times out on github-action runners
4-
5-
output:
6-
# Sort results by: filepath, line and column.
7-
sort-results: true
2+
version: "2"
3+
linters:
4+
exclusions:
5+
generated: lax
6+
presets:
7+
- comments
8+
- common-false-positives
9+
- legacy
10+
- std-error-handling
11+
paths:
12+
- third_party$
13+
- builtin$
14+
- examples$
15+
formatters:
16+
exclusions:
17+
generated: lax
18+
paths:
19+
- third_party$
20+
- builtin$
21+
- examples$

crypto/multiple_digest.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (m MultipleDigest) VerifyFilePath(filePath string, fs boshsys.FileSystem) e
104104

105105
func (m MultipleDigest) validate() error {
106106
if len(m.digests) == 0 {
107-
return errors.New("Expected to find at least one digest")
107+
return errors.New("Expected to find at least one digest") //nolint:staticcheck
108108
}
109109

110110
algosUsed := map[string]struct{}{}
@@ -192,7 +192,7 @@ func (m MultipleDigest) parseMultipleDigestString(multipleDigest string) (Multip
192192
}
193193

194194
if len(digests) == 0 {
195-
return MultipleDigest{}, errors.New("No digest algorithm found. Supported algorithms: sha1, sha256, sha512")
195+
return MultipleDigest{}, errors.New("No digest algorithm found. Supported algorithms: sha1, sha256, sha512") //nolint:staticcheck
196196
}
197197

198198
return MultipleDigest{digests: digests}, nil
@@ -213,7 +213,7 @@ func (MultipleDigest) parseDigestString(digest string) (Digest, error) {
213213

214214
for _, piece := range pieces {
215215
if !isStringAlphanumeric(piece) {
216-
return nil, errors.New("Unable to parse digest string. Digest and algorithm key can only contain alpha-numeric characters.")
216+
return nil, errors.New("Unable to parse digest string. Digest and algorithm key can only contain alpha-numeric characters.") //nolint:staticcheck
217217
}
218218
}
219219

errors/multi_error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewMultiError(errors ...error) error {
1313
}
1414

1515
func (e MultiError) Error() string {
16-
errors := make([]string, len(e.Errors), len(e.Errors)) //nolint:gosimple
16+
errors := make([]string, len(e.Errors), len(e.Errors)) //nolint:staticcheck
1717
for i, err := range e.Errors {
1818
errors[i] = err.Error()
1919
}

fileutil/tarball_compressor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (c tarballCompressor) CompressSpecificFilesInDir(dir string, files []string
5353
args = append([]string{"--no-mac-metadata"}, args...)
5454
}
5555

56-
for _, file := range files { //nolint:gosimple
56+
for _, file := range files { //nolint:staticcheck
5757
args = append(args, file)
5858
}
5959

httpclient/http_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func scrubEndpointQuery(endpoint string) string {
171171
}
172172

173173
query := parsedURL.Query()
174-
for key, _ := range query { //nolint:gosimple
174+
for key, _ := range query { //nolint:staticcheck
175175
query[key] = []string{"<redacted>"}
176176
}
177177

logger/async_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ var _ = Describe("Logger", func() {
182182
tick := time.NewTicker(WriteInterval / 10)
183183
defer tick.Stop()
184184
go func() {
185-
for _ = range tick.C { //nolint:gosimple
185+
for _ = range tick.C { //nolint:staticcheck
186186
logger.Debug("NEW", "new")
187187
}
188188
}()

logger/logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func Levelify(levelString string) (LogLevel, error) {
3939
level, ok := levels[upperLevelString]
4040
if !ok {
4141
expected := strings.Join(levelKeys, ", ")
42-
return level, fmt.Errorf("Unknown LogLevel string '%s', expected one of [%s]", levelString, expected)
42+
return level, fmt.Errorf("Unknown LogLevel string '%s', expected one of [%s]", levelString, expected) //nolint:staticcheck
4343
}
4444
return level, nil
4545
}

property/builders.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func BuildMap(rawProperties map[interface{}]interface{}) (Map, error) {
3030
// BuildList creates a new property List from an slice of interface{}, erroring if any elements are maps with non-string keys.
3131
// Slices in the property List are converted to property Lists. Maps in the property List are converted to property Maps.
3232
func BuildList(rawProperties []interface{}) (List, error) {
33-
result := make(List, len(rawProperties), len(rawProperties)) //nolint:gosimple
33+
result := make(List, len(rawProperties), len(rawProperties)) //nolint:staticcheck
3434

3535
for i, val := range rawProperties {
3636
convertedVal, err := Build(val)

system/exec_cmd_runner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func unixCommand(cmdName string) Command {
9393

9494
func parseEnvFields(envDump string, convertKeysToUpper bool) map[string]string {
9595
fields := make(map[string]string)
96-
envDump = strings.Replace(envDump, "\r", "", -1)
96+
envDump = strings.Replace(envDump, "\r", "", -1) //nolint:staticcheck
9797
for _, line := range strings.Split(envDump, "\n") {
9898
// don't split on '=' as '=' is allowed in the value on Windows
9999
if n := strings.IndexByte(line, '='); n != -1 {

0 commit comments

Comments
 (0)