all: consistently use %w instead of %s in when error is passed to fmt.Errorf()

This allows consistently using errors.Is() for verifying whether the given error wraps some other known error.
This commit is contained in:
Aliaksandr Valialkin
2023-10-25 21:24:01 +02:00
parent dc6a718a52
commit 36a1fdca6c
43 changed files with 84 additions and 84 deletions

View File

@@ -204,7 +204,7 @@ func gzipHandler(s *server, rh RequestHandler) http.HandlerFunc {
var gzipHandlerWrapper = func() func(http.Handler) http.HandlerFunc {
hw, err := gzhttp.NewWrapper(gzhttp.CompressionLevel(1))
if err != nil {
panic(fmt.Errorf("BUG: cannot initialize gzip http wrapper: %s", err))
panic(fmt.Errorf("BUG: cannot initialize gzip http wrapper: %w", err))
}
return hw
}()