diff --git a/.golangci.yml b/.golangci.yml index 66204bd157..3b0e746c0b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,6 +15,8 @@ linters-settings: - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + disable: + - composites linters: disable-all: true @@ -24,8 +26,8 @@ linters: - govet - errcheck - deadcode - - misspell - + # TODI(kushthedude) fix after vendor is migrated to go modules + # - misspell service: golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly diff --git a/clusterloader2/pkg/measurement/util/resource.go b/clusterloader2/pkg/measurement/util/resource.go index e677f8e9d0..d6b479c1d7 100644 --- a/clusterloader2/pkg/measurement/util/resource.go +++ b/clusterloader2/pkg/measurement/util/resource.go @@ -46,8 +46,8 @@ type UsageDataPerContainer struct { // ResourceConstraint specifies constraint on resources. type ResourceConstraint struct { - CPUConstraint float64 `json: cpuConstraint` - MemoryConstraint uint64 `json: memoryConstraint` + CPUConstraint float64 `json:"cpuConstraint"` + MemoryConstraint uint64 `json:"memoryConstraint"` } // SingleContainerSummary is a resource usage summary for a single container. diff --git a/clusterloader2/pkg/prometheus/util.go b/clusterloader2/pkg/prometheus/util.go index a9c30c9351..6a99192421 100644 --- a/clusterloader2/pkg/prometheus/util.go +++ b/clusterloader2/pkg/prometheus/util.go @@ -29,7 +29,7 @@ import ( const allTargets = -1 type targetsResponse struct { - Data targetsData `json:"data""` + Data targetsData `json:"data"` } type targetsData struct { diff --git a/slo-monitor/src/monitors/store.go b/slo-monitor/src/monitors/store.go index 0cecc98438..044cfce847 100644 --- a/slo-monitor/src/monitors/store.go +++ b/slo-monitor/src/monitors/store.go @@ -86,7 +86,7 @@ func (q *NoStoreQueue) enqueueOrModifyItemLocked(key string, obj interface{}, op func (q *NoStoreQueue) Add(obj interface{}) error { key, err := keyFunc(obj) if err != nil { - return cache.KeyError{obj, err} + return cache.KeyError{Obj: obj, Err: err} } defer q.cond.Broadcast() @@ -105,7 +105,7 @@ func (q *NoStoreQueue) Update(obj interface{}) error { func (q *NoStoreQueue) Delete(obj interface{}) error { key, err := keyFunc(obj) if err != nil { - return cache.KeyError{obj, err} + return cache.KeyError{Obj: obj, Err: err} } defer q.cond.Broadcast() @@ -186,7 +186,7 @@ func (q *NoStoreQueue) Pop(process cache.PopProcessFunc) (interface{}, error) { func (q *NoStoreQueue) AddIfNotPresent(obj interface{}) error { key, err := keyFunc(obj) if err != nil { - return cache.KeyError{obj, err} + return cache.KeyError{Obj: obj, Err: err} } defer q.cond.Broadcast()