From b0bb4acc112a0bf2e57e713d7cfcbab469cc43c0 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 25 Jul 2025 00:08:26 +0200 Subject: [PATCH] internal/registry: fix linting issues (revive) internal/registry/errors.go:26:43: use-any: since Go 1.18 'interface{}' can be replaced by 'any' (revive) func invalidParamf(format string, args ...interface{}) error { ^ internal/registry/registry_mock_test.go:52:51: use-any: since Go 1.18 'interface{}' can be replaced by 'any' (revive) func writeResponse(w http.ResponseWriter, message interface{}, code int) { ^ Signed-off-by: Sebastiaan van Stijn (cherry picked from commit f907c7a4b03898455d024920f38fef3545a29c05) Signed-off-by: Sebastiaan van Stijn --- internal/registry/errors.go | 5 ++++- internal/registry/registry_mock_test.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/registry/errors.go b/internal/registry/errors.go index 9b321ab015..e27eb3e7a6 100644 --- a/internal/registry/errors.go +++ b/internal/registry/errors.go @@ -1,3 +1,6 @@ +// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: +//go:build go1.23 + package registry import ( @@ -23,7 +26,7 @@ func invalidParam(err error) error { return invalidParameterErr{err} } -func invalidParamf(format string, args ...interface{}) error { +func invalidParamf(format string, args ...any) error { return invalidParameterErr{fmt.Errorf(format, args...)} } diff --git a/internal/registry/registry_mock_test.go b/internal/registry/registry_mock_test.go index 6ccabce5bc..13c637852e 100644 --- a/internal/registry/registry_mock_test.go +++ b/internal/registry/registry_mock_test.go @@ -49,7 +49,7 @@ func writeHeaders(w http.ResponseWriter) { h.Add("Cache-Control", "no-cache") } -func writeResponse(w http.ResponseWriter, message interface{}, code int) { +func writeResponse(w http.ResponseWriter, message any, code int) { writeHeaders(w) w.WriteHeader(code) body, err := json.Marshal(message)