Fix findings to make lint pass

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
This commit is contained in:
Manuel Rüger 2021-11-18 16:08:33 +01:00
parent f4510e454b
commit 2e78af1ccd
5 changed files with 13 additions and 11 deletions

View File

@ -1,20 +1,21 @@
run:
deadline: 2m
deadline: 5m
linters:
disable-all: true
enable:
- gocritic
- gocyclo
- gofmt
- goimports
- golint
- staticcheck
- gocyclo
- gosimple
- govet
- ineffassign
- misspell
- gocritic
- govet
- unconvert
- promlinter
- revive
- staticcheck
- unconvert
linters-settings:
goimports:

View File

@ -33,7 +33,7 @@ import (
var (
descPersistentVolumeClaimRefName = "kube_persistentvolume_claim_ref"
descPersistentVolumeClaimRefHelp = "Information about the Persitant Volume Claim Reference."
descPersistentVolumeClaimRefHelp = "Information about the Persistent Volume Claim Reference."
descPersistentVolumeClaimRefDefaultLabels = []string{"persistentvolume"}
descPersistentVolumeAnnotationsName = "kube_persistentvolume_annotations"

View File

@ -441,7 +441,7 @@ func TestPersistentVolumeStore(t *testing.T) {
},
},
Want: `
# HELP kube_persistentvolume_claim_ref Information about the Persitant Volume Claim Reference.
# HELP kube_persistentvolume_claim_ref Information about the Persistent Volume Claim Reference.
# TYPE kube_persistentvolume_claim_ref gauge
kube_persistentvolume_claim_ref{claim_namespace="default",name="pv-claim",persistentvolume="test-claimed-pv"} 1
`,
@ -457,7 +457,7 @@ func TestPersistentVolumeStore(t *testing.T) {
},
},
Want: `
# HELP kube_persistentvolume_claim_ref Information about the Persitant Volume Claim Reference.
# HELP kube_persistentvolume_claim_ref Information about the Persistent Volume Claim Reference.
# TYPE kube_persistentvolume_claim_ref gauge
`,
MetricNames: []string{"kube_persistentvolume_claim_ref"},

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
/*

View File

@ -121,7 +121,7 @@ func TestDocumentation(t *testing.T) {
for _, labelPattern := range acceptedLabelNames {
re, err := regexp.Compile(labelPattern)
if err != nil {
t.Errorf("Cannot compile pattern %s: %w", labelPattern, err)
t.Errorf("Cannot compile pattern %s: %v", labelPattern, err)
continue
}
if re.MatchString(labelName) {