Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit c284589

Browse files
authored
Update golangci-lint to 1.50.1 (#2614)
* update version of golangci-lint * apply new linting rules * install genny with @latest
1 parent 5dbb6fe commit c284589

File tree

39 files changed

+41
-37
lines changed

39 files changed

+41
-37
lines changed

.github/workflows/go-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313

1414
env:
1515
GO_VERSION: 1.18.7
16-
LINT_VERSION: 1.48.0
16+
LINT_VERSION: 1.50.1
1717

1818
jobs:
1919
go-lint:

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ linters:
120120
- usestdlibvars
121121
- varnamelen
122122
- wrapcheck
123+
# We disable those new linters as we are looking to minimize code changes.
124+
- interfacebloat
125+
- contextcheck
123126

124127

125128
linters-settings:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ image:
8989

9090
.PHONY: tidy
9191
tidy:
92-
go mod tidy -compat=1.17
92+
go mod tidy -compat=1.18
9393

9494
.PHONY: signalfx-agent
9595
signalfx-agent: gofmt

docs/monitors/collectd-jenkins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Configuration](../monitor-config.md#common-configuration).**
8888
| `path` | no | `string` | |
8989
| `metricsKey` | **yes** | `string` | Key required for collecting metrics. The access key located at `Manage Jenkins > Configure System > Metrics > ADD.` If empty, click `Generate`. |
9090
| `enhancedMetrics` | no | `bool` | Whether to enable enhanced metrics (**default:** `false`) |
91-
| `excludeJobMetrics` | no | `bool` | Set to *true* to to exclude job metrics retrieved from `/api/json` endpoint (**default:** `false`) |
91+
| `excludeJobMetrics` | no | `bool` | Set to *true* to exclude job metrics retrieved from `/api/json` endpoint (**default:** `false`) |
9292
| `includeMetrics` | no | `list of strings` | Used to enable individual enhanced metrics when `enhancedMetrics` is false |
9393
| `username` | no | `string` | User with security access to jenkins |
9494
| `apiToken` | no | `string` | API Token of the user |

pkg/core/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/signalfx/signalfx-agent/pkg/utils"
2828
)
2929

30-
//go:generate sh -c "test -e `go env GOPATH`/bin/genny > /dev/null || (cd ../.. && go install github.com/mauricelam/genny@latest)"
30+
//go:generate sh -c "test -e `go env GOPATH`/bin/genny > /dev/null || (cd ../.. && go install github.com/mauricelam/genny)"
3131

3232
const (
3333
// Items should stay in these channels only very briefly as there should be

pkg/core/config/sources/zookeeper/zookeeper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (z *zkConfigSource) Get(path string) (map[string][]byte, uint64, error) {
9999
// ConfigSource since it doesn't have any concept of a global index counter
100100
// that can be used to ensure updates aren't missed, and it also doesn't have
101101
// the ability to watch child nodes recursively. Therefore, for now we just
102-
// limit globbing to to asterisks at the very end of a node. If we need more
102+
// limit globbing to asterisks at the very end of a node. If we need more
103103
// complex globbing, consider something like
104104
// https://github.com/kelseyhightower/confd/blob/master/backends/zookeeper/client.go
105105
func (z *zkConfigSource) getNodes(path string, watch bool) (map[string][]byte, uint64, []<-chan zk.Event, error) {

pkg/core/writer/dimensions/dedup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (dd *deduplicator) Add(dim *types.Dimension) {
8181
}
8282

8383
// If we are merging dimension props/tags, then just keep all the updates
84-
// in the the cached copy so we will know if an update is going to change
84+
// in the cached copy so we will know if an update is going to change
8585
// anything or not.
8686
if cachedDim.Properties == nil {
8787
cachedDim.Properties = map[string]string{}

pkg/monitors/aspdotnet/aspdotnet_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (m *Monitor) Configure(conf *Config) error {
8888
// create the accumulator
8989
ac := accumulator.NewAccumulator(emitter)
9090

91-
// create contexts for managing the the plugin loop
91+
// create contexts for managing the plugin loop
9292
var ctx context.Context
9393
ctx, m.cancel = context.WithCancel(context.Background())
9494

pkg/monitors/cloudfoundry/monitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ type Monitor struct {
6666
func (m *Monitor) Configure(conf *Config) error {
6767
m.logger = logrus.WithFields(logrus.Fields{"monitorType": monitorType, "monitorID": conf.MonitorID})
6868

69-
// create contexts for managing the the plugin loop
69+
// create contexts for managing the plugin loop
7070
var ctx context.Context
7171
ctx, m.cancel = context.WithCancel(context.Background())
7272

pkg/monitors/collectd/jenkins/jenkins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Config struct {
3636
MetricsKey string `yaml:"metricsKey" validate:"required"`
3737
// Whether to enable enhanced metrics
3838
EnhancedMetrics *bool `yaml:"enhancedMetrics"`
39-
// Set to *true* to to exclude job metrics retrieved from `/api/json` endpoint
39+
// Set to *true* to exclude job metrics retrieved from `/api/json` endpoint
4040
ExcludeJobMetrics *bool `yaml:"excludeJobMetrics"`
4141
// Used to enable individual enhanced metrics when `enhancedMetrics` is
4242
// false

0 commit comments

Comments
 (0)