aboutsummaryrefslogtreecommitdiff
path: root/pkg/ext
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/ext')
-rw-r--r--pkg/ext/compression.go6
-rw-r--r--pkg/ext/router.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/ext/compression.go b/pkg/ext/compression.go
index 9e933ef..6c7a219 100644
--- a/pkg/ext/compression.go
+++ b/pkg/ext/compression.go
@@ -16,7 +16,7 @@ import (
)
var (
- invalidParamErr = errors.New("Invalid weighted param")
+ errInvalidParam = errors.New("Invalid weighted param")
)
type CompressionResponseWriter struct {
@@ -135,7 +135,7 @@ func GetLZWWriter(w io.Writer) io.WriteCloser {
func getWeighedValue(part string) (float64, error) {
ps := strings.SplitN(part, "=", 2)
if len(ps) != 2 {
- return 0, invalidParamErr
+ return 0, errInvalidParam
}
if name := strings.TrimSpace(ps[0]); name == "q" {
w, err := strconv.ParseFloat(ps[1], 64)
@@ -145,5 +145,5 @@ func getWeighedValue(part string) (float64, error) {
return w, nil
}
- return 0, invalidParamErr
+ return 0, errInvalidParam
}
diff --git a/pkg/ext/router.go b/pkg/ext/router.go
index 5d22814..96da1c9 100644
--- a/pkg/ext/router.go
+++ b/pkg/ext/router.go
@@ -34,7 +34,7 @@ func (r *Router) AddMiddleware(middleware Middleware) {
func wrapError(next ErrorRequestHandler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if err := next(w, r); err != nil {
- if errors.Is(err, service.RepositoryNotFoundErr) {
+ if errors.Is(err, service.ErrRepositoryNotFound) {
NotFound(w)
} else {
InternalServerError(w, err)