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 <github@gone.nl>
(cherry picked from commit f907c7a4b0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-07-25 00:08:26 +02:00
parent 2e5a36728b
commit b0bb4acc11
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 5 additions and 2 deletions

View File

@ -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...)}
}

View File

@ -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)