chore: Enable G101 rule for gosec (#13009)

Co-authored-by: Pawel Zak <Pawel Zak>
This commit is contained in:
Paweł Żak 2023-04-03 20:31:08 +02:00 committed by GitHub
parent 0754247d79
commit 2320bbd1a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -88,6 +88,7 @@ linters-settings:
# Available rules: https://github.com/securego/gosec#available-rules
# Default: [] - means include all rules
includes:
- G101
- G102
- G106
- G107
@ -239,6 +240,9 @@ issues:
- path: cmd/telegraf/(main|printer).go
text: "unhandled-error: Unhandled error in call to function outputBuffer.Write"
- path: _test\.go
text: "Potential hardcoded credentials"
# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option.
# To list all excluded by default patterns execute `golangci-lint run --help`.

View File

@ -63,8 +63,9 @@ type MetadataIamToken struct {
}
const (
defaultRequestTimeout = time.Second * 20
defaultEndpointURL = "https://monitoring.api.cloud.yandex.net/monitoring/v2/data/write"
defaultRequestTimeout = time.Second * 20
defaultEndpointURL = "https://monitoring.api.cloud.yandex.net/monitoring/v2/data/write"
//nolint:gosec // G101: Potential hardcoded credentials - false positive
defaultMetadataTokenURL = "http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token"
defaultMetadataFolderURL = "http://169.254.169.254/computeMetadata/v1/yandex/folder-id"
)