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

Commit 21bc3cd

Browse files
committed
apply new linting rules
1 parent 9782208 commit 21bc3cd

File tree

37 files changed

+39
-35
lines changed

37 files changed

+39
-35
lines changed

.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/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

pkg/monitors/cpu/cpu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func (m *Monitor) initializePerCoreCPUTimes() {
225225
func (m *Monitor) Configure(conf *Config) error {
226226
m.logger = logrus.WithFields(logrus.Fields{"monitorType": monitorType, "monitorID": conf.MonitorID})
227227

228-
// create contexts for managing the the plugin loop
228+
// create contexts for managing the plugin loop
229229
var ctx context.Context
230230
ctx, m.cancel = context.WithCancel(context.Background())
231231

pkg/monitors/diskio/diskio_others.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (m *Monitor) emitDatapoints() {
7878
// Configure is the main function of the monitor, it will report host metadata
7979
// on a varied interval
8080
func (m *Monitor) Configure(conf *Config) error {
81-
// create contexts for managing the the plugin loop
81+
// create contexts for managing the plugin loop
8282
var ctx context.Context
8383
ctx, m.cancel = context.WithCancel(context.Background())
8484

0 commit comments

Comments
 (0)