Skip to content

Commit

Permalink
fix golangci lint
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <[email protected]>
  • Loading branch information
pepov committed Sep 26, 2024
1 parent 332c9f7 commit b5b5ffa
Show file tree
Hide file tree
Showing 37 changed files with 43 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'

- name: Lint
run: make lint
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'

- name: Cache licenses
uses: actions/cache@v3
Expand Down
11 changes: 4 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
run:
skip-dirs:
- .gen
- client

linters-settings:
revive:
min-confidence: 0.9
gocyclo:
min-complexity: 15

linters:

issues:
exclude:
exclude-dirs:
- .gen
- client
exclude:
- if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
- "`if` block ends with a `return` statement, so drop this `else` and outdent its block"
- "missing the call to method parallel"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ENVTEST_BINARY_ASSETS := ${ENVTEST_BIN_DIR}/bin

GOLANGCI_LINT := ${BIN}/golangci-lint
GOLANGCI_LINT_VERSION := v1.61.0
LINTER_FLAGS := --timeout 5m
LINTER_FLAGS := --timeout 10m

HELM_DOCS := ${BIN}/helm-docs
HELM_DOCS_VERSION = 1.11.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: eventtailers.logging-extensions.banzaicloud.io
spec:
group: logging-extensions.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: hosttailers.logging-extensions.banzaicloud.io
spec:
group: logging-extensions.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: clusterflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: clusteroutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: flows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: fluentbitagents.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: fluentdconfigs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: loggingroutes.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: loggings.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: nodeagents.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: outputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngclusterflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngclusteroutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngconfigs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngoutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: eventtailers.logging-extensions.banzaicloud.io
spec:
group: logging-extensions.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: hosttailers.logging-extensions.banzaicloud.io
spec:
group: logging-extensions.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_clusterflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: clusterflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: clusteroutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_flows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: flows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: fluentbitagents.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: fluentdconfigs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_loggingroutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: loggingroutes.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_loggings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: loggings.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_nodeagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: nodeagents.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: outputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngclusterflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngclusteroutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngconfigs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_syslogngflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngoutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
5 changes: 3 additions & 2 deletions pkg/sdk/logging/model/output/logdna_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ package output_test
import (
"testing"

"sigs.k8s.io/yaml"

"github.com/kube-logging/logging-operator/pkg/sdk/logging/model/output"
"github.com/kube-logging/logging-operator/pkg/sdk/logging/model/render"
"sigs.k8s.io/yaml"
)

func TestLogDNAOutput(t *testing.T) {
Expand Down Expand Up @@ -60,7 +61,7 @@ buffer:
logdna := &output.LogDNAOutput{}
err := yaml.Unmarshal(CONFIG, logdna)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
test := render.NewOutputPluginTest(t, logdna)
test.DiffResult(expected)
Expand Down
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"gomodTidy"
],
"constraints": {
"go": "1.22"
"go": "1.23"
},
"labels": ["dependencies"],
"packageRules": [
Expand Down

0 comments on commit b5b5ffa

Please sign in to comment.