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 305c96e384
commit 42dd71bb63
42 changed files with 83 additions and 83 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
}()