diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..cdd2defc --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,28 @@ +version: "2" +linters: + default: standard + enable: + - unparam + +formatters: + enable: + - gofmt + - goimports + settings: + gofmt: + rewrite-rules: + - pattern: 'interface{}' + replacement: 'any' + +issues: + max-same-issues: 100 + + exclude-files: + - generated.*\\.go + + exclude-dirs: + - client + - vendor + +run: + timeout: 10m diff --git a/Makefile b/Makefile index 683d6196..3fd38c3a 100644 --- a/Makefile +++ b/Makefile @@ -340,7 +340,7 @@ lint: $(BUILD_DIRS) --env GO111MODULE=on \ --env GOFLAGS="-mod=vendor" \ $(BUILD_IMAGE) \ - golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default --exclude-dirs=client,vendor + golangci-lint run $(BUILD_DIRS): @mkdir -p $@ diff --git a/go.mod b/go.mod index 08fcfe56..6461bdc8 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module stash.appscode.dev/ui-server -go 1.23.0 - -toolchain go1.24.4 +go 1.25.5 require ( github.com/lnquy/cron v1.1.1 diff --git a/pkg/registry/ui/backups/backupoverview.go b/pkg/registry/ui/backups/backupoverview.go index a733714b..e0c18c65 100644 --- a/pkg/registry/ui/backups/backupoverview.go +++ b/pkg/registry/ui/backups/backupoverview.go @@ -233,7 +233,7 @@ func (r *BackupOverviewStorage) getBackupOverview(ctx context.Context, cfg *stas result.ManagedFields = nil result.OwnerReferences = nil result.Finalizers = nil - delete(result.ObjectMeta.Annotations, mu.LastAppliedConfigAnnotation) + delete(result.Annotations, mu.LastAppliedConfigAnnotation) return result, nil } diff --git a/pkg/shared/db.go b/pkg/shared/db.go index 4387f64b..2e832b9b 100644 --- a/pkg/shared/db.go +++ b/pkg/shared/db.go @@ -29,7 +29,7 @@ const ( Timeout = 4 * time.Second ) -func GetDBVersion(obj map[string]interface{}) (string, error) { +func GetDBVersion(obj map[string]any) (string, error) { val, found, err := unstructured.NestedFieldCopy(obj, "spec", "version") if err != nil { return "", err @@ -40,7 +40,7 @@ func GetDBVersion(obj map[string]interface{}) (string, error) { return val.(string), nil } -func GetDatabaseType(obj map[string]interface{}) (string, error) { +func GetDatabaseType(obj map[string]any) (string, error) { mode, err := resourcemetrics.Mode(obj) if err != nil { return "", err @@ -48,7 +48,7 @@ func GetDatabaseType(obj map[string]interface{}) (string, error) { return mode, nil } -func GetDatabaseStatus(obj map[string]interface{}) (string, error) { +func GetDatabaseStatus(obj map[string]any) (string, error) { val, found, err := unstructured.NestedFieldCopy(obj, "status", "phase") if err != nil { return "", err