Skip to content

Commit

Permalink
chore: Enable G101 rule for gosec (#13009)
Browse files Browse the repository at this point in the history
Co-authored-by: Pawel Zak <Pawel Zak>
  • Loading branch information
zak-pawel committed Apr 3, 2023
1 parent 0754247 commit 2320bbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit 2320bbd

Please sign in to comment.