aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Oleksandr Redko <Oleksandr_Redko@epam.com> 2023-11-12 17:42:39 +0200
committerGravatar GitHub <noreply@github.com> 2023-11-12 16:42:39 +0100
commit8ecfc989d9c4c6c30232a6465ec17d5c6d85fc5f (patch)
tree9a1fd803e343e8363409b4d83148ebbc6203e370
parentLazy load stackless functions (#1656) (diff)
downloadfasthttp-8ecfc989d9c4c6c30232a6465ec17d5c6d85fc5f.tar.gz
fasthttp-8ecfc989d9c4c6c30232a6465ec17d5c6d85fc5f.tar.bz2
fasthttp-8ecfc989d9c4c6c30232a6465ec17d5c6d85fc5f.zip
Enable dupword, unconvert linters (#1658)v1.51.0
-rw-r--r--.golangci.yml2
-rw-r--r--bytesconv_test.go2
-rw-r--r--client.go1
-rw-r--r--fs.go4
-rw-r--r--http_test.go2
5 files changed, 5 insertions, 6 deletions
diff --git a/.golangci.yml b/.golangci.yml
index 483c67a..ad75ddf 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -11,7 +11,6 @@ linters:
- cyclop
- depguard
- dupl
- - dupword
- errname
- errorlint
- exhaustive
@@ -43,7 +42,6 @@ linters:
- testpackage
- thelper
- tparallel
- - unconvert
- unparam
- usestdlibvars
- varnamelen
diff --git a/bytesconv_test.go b/bytesconv_test.go
index c9034ec..4449810 100644
--- a/bytesconv_test.go
+++ b/bytesconv_test.go
@@ -37,7 +37,7 @@ func TestAppendHTMLEscape(t *testing.T) {
allcases[i] = byte(i)
}
res := string(AppendHTMLEscape(nil, string(allcases)))
- expect := string(html.EscapeString(string(allcases)))
+ expect := html.EscapeString(string(allcases))
if res != expect {
t.Fatalf("unexpected string %q. Expecting %q.", res, expect)
}
diff --git a/client.go b/client.go
index c5251e1..498de05 100644
--- a/client.go
+++ b/client.go
@@ -1474,6 +1474,7 @@ func (c *HostClient) acquireConn(reqTimeout time.Duration, connectionClose bool)
return nil, ErrNoFreeConns
}
+ //nolint:dupword
// reqTimeout c.MaxConnWaitTimeout wait duration
// d1 d2 min(d1, d2)
// 0(not set) d2 d2
diff --git a/fs.go b/fs.go
index 9ada758..c231d80 100644
--- a/fs.go
+++ b/fs.go
@@ -870,7 +870,7 @@ func (cm *inMemoryCacheManager) GetFileFromCache(cacheKind CacheKind, path strin
fileCache := cm.getFsCache(cacheKind)
cm.cacheLock.Lock()
- ff, ok := fileCache[string(path)]
+ ff, ok := fileCache[path]
if ok {
ff.readersCount++
}
@@ -1594,7 +1594,7 @@ func (h *fsHandler) newFSFile(f fs.File, fileInfo fs.FileInfo, compressed bool,
}
func readFileHeader(f io.Reader, compressed bool, fileEncoding string) ([]byte, error) {
- r := io.Reader(f)
+ r := f
var (
br *brotli.Reader
zr *gzip.Reader
diff --git a/http_test.go b/http_test.go
index 0091566..7b526cb 100644
--- a/http_test.go
+++ b/http_test.go
@@ -3022,7 +3022,7 @@ func TestResponseBodyStream(t *testing.T) {
}
})
- t.Run("limit response body size size", func(t *testing.T) {
+ t.Run("limit response body size", func(t *testing.T) {
t.Parallel()
client := Client{StreamResponseBody: true, MaxResponseBodySize: 20}