Skip to content

Commit

Permalink
Update golangci-lint to v1.60.3
Browse files Browse the repository at this point in the history
  • Loading branch information
thbkrkr committed Aug 28, 2024
1 parent 44d6701 commit d1f9141
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ $(GOBIN)/go-licence-detector:
@ go install go.elastic.co/[email protected]

$(GOBIN)/golangci-lint:
@ go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
@ go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
Long: "Dump ECK and Kubernetes data for support and troubleshooting purposes.",
PreRunE: preRunOperations,
Version: internal.Version(),
RunE: func(_ *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
return internal.Run(diagParams)
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/diag.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func Run(params Params) error {
operatorVersions = append(operatorVersions, detectECKVersion(clientSet, ns, params.ECKVersion))
}

maxOperatorVersion := max(operatorVersions)
maxOperatorVersion := maxVersion(operatorVersions)
logVersion(maxOperatorVersion)

allNamespaces := sets.New(params.ResourcesNamespaces...)
Expand Down
6 changes: 3 additions & 3 deletions internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func extractVersionFromContainers(containers []corev1.Container) *version.Versio
if strings.Contains(container.Image, "eck-operator") {
parsed, err := extractVersionFromDockerImage(container.Image)
if err != nil {
logger.Printf(err.Error())
logger.Print(err.Error())
return fallbackMaxVersion
}
return parsed
Expand Down Expand Up @@ -142,8 +142,8 @@ func extractVersionFromDockerImage(image string) (*version.Version, error) {
return fallbackMaxVersion, nil
}

// max returns the maximum of the given versions.
func max(versions []*version.Version) *version.Version {
// maxVersion returns the maximum of the given versions.
func maxVersion(versions []*version.Version) *version.Version {
if len(versions) == 0 {
return fallbackMaxVersion
}
Expand Down
2 changes: 1 addition & 1 deletion internal/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Test_min(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := max(tt.args.versions); !reflect.DeepEqual(got, tt.want) {
if got := maxVersion(tt.args.versions); !reflect.DeepEqual(got, tt.want) {
t.Errorf("max() = %v, want %v", got, tt.want)
}
})
Expand Down

0 comments on commit d1f9141

Please sign in to comment.