mirror of https://github.com/docker/cli.git
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:
parent
2e5a36728b
commit
b0bb4acc11
|
|
@ -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...)}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue