From 028d821beae35dac01a795269e58db5ab5a9cc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Fri, 3 Feb 2023 13:59:47 +0100 Subject: [PATCH] prepare release --- .golangci.yml | 3 +++ middleware/favicon/favicon.go | 8 ++++---- path.go | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b44f788eb7..c58d52511e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -86,6 +86,9 @@ linters-settings: disabled: true - name: cyclomatic disabled: true + - name: early-return + severity: warning + disabled: true - name: exported disabled: true - name: file-header diff --git a/middleware/favicon/favicon.go b/middleware/favicon/favicon.go index ba192f9423..84572b6d0f 100644 --- a/middleware/favicon/favicon.go +++ b/middleware/favicon/favicon.go @@ -19,23 +19,23 @@ type Config struct { // File holds the path to an actual favicon that will be cached // // Optional. Default: "" - File string + File string `json:"file"` // URL for favicon handler // // Optional. Default: "/favicon.ico" - URL string + URL string `json:"url"` // FileSystem is an optional alternate filesystem to search for the favicon in. // An example of this could be an embedded or network filesystem // // Optional. Default: nil - FileSystem http.FileSystem + FileSystem http.FileSystem `json:"-"` // CacheControl defines how the Cache-Control header in the response should be set // // Optional. Default: "public, max-age=31536000" - CacheControl string + CacheControl string `json:"cache_control"` } // ConfigDefault is the default config diff --git a/path.go b/path.go index 83f7c237fc..f7e726f8c2 100644 --- a/path.go +++ b/path.go @@ -572,7 +572,7 @@ func findGreedyParamLen(s string, searchCount int, segment *routeSegment) int { // check all from right to left segments for i := segment.PartCount; i > 0 && searchCount > 0; i-- { searchCount-- - if constPosition := strings.LastIndex(s, segment.ComparePart); constPosition != -1 { //nolint:revive // Actually not simpler + if constPosition := strings.LastIndex(s, segment.ComparePart); constPosition != -1 { s = s[:constPosition] } else { break