Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Enable G101 rule for gosec #13009

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ linters-settings:
# Available rules: https://github.com/securego/gosec#available-rules
# Default: [] - means include all rules
includes:
- G101
- G102
- G106
- G108
Expand Down Expand Up @@ -231,6 +232,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