Skip to content

Commit caa9e61

Browse files
committed
fix go vet issue (go1.24+)
Signed-off-by: Frederic BIDON <[email protected]>
1 parent 63e8809 commit caa9e61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ func NotFound(message string, args ...interface{}) Error {
7171
if message == "" {
7272
message = "Not found"
7373
}
74-
return New(http.StatusNotFound, fmt.Sprintf(message, args...))
74+
return New(http.StatusNotFound, message, args...)
7575
}
7676

7777
// NotImplemented creates a new not implemented error
7878
func NotImplemented(message string) Error {
79-
return New(http.StatusNotImplemented, message)
79+
return New(http.StatusNotImplemented, "%s", message)
8080
}
8181

8282
// MethodNotAllowedError represents an error for when the path matches but the method doesn't
@@ -179,7 +179,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
179179
default:
180180
rw.WriteHeader(http.StatusInternalServerError)
181181
if r == nil || r.Method != http.MethodHead {
182-
_, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, err.Error())))
182+
_, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "%v", err)))
183183
}
184184
}
185185
}

0 commit comments

Comments
 (0)