Skip to content

Commit af80d74

Browse files
authored
chore: add support for durationcheck, mirror, gochecksumtype (#2177)
1 parent 51e122c commit af80d74

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ linters:
1414
- decorder # check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false]
1515
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]
1616
- dupword # checks for duplicate words in the source code [fast: true, auto-fix: true]
17+
- durationcheck # check for two durations multiplied together [fast: false, auto-fix: false]
1718
- gci # Gci controls golang package import order and makes it always deterministic. [fast: true, auto-fix: false]
19+
- gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid. [fast: true, auto-fix: false]
20+
- gochecksumtype # Run exhaustiveness checks on Go "sum types" [fast: false, auto-fix: false]
1821
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
1922
- gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true]
2023
- goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt. [fast: true, auto-fix: true]
24+
- mirror # reports wrong mirror patterns of bytes/strings usage [fast: false, auto-fix: false]
2125
- whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true]
2226

2327
issues:

api/instance/v1/instance_metadata_sdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ func (meta *MetadataAPI) DeleteUserData(key string) error {
298298
}).DialContext,
299299
},
300300
}
301-
request, err := http.NewRequest("DELETE", meta.getMetadataUrl()+"/user_data/"+key, bytes.NewBuffer([]byte("")))
301+
request, err := http.NewRequest("DELETE", meta.getMetadataUrl()+"/user_data/"+key, bytes.NewBufferString(""))
302302
if err != nil {
303303
return errors.Wrap(err, "error creating delete userdata request")
304304
}

0 commit comments

Comments
 (0)