Skip to content

Commit

Permalink
Enable dupword, unconvert linters (#1658)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Nov 12, 2023
1 parent 1834cec commit 8ecfc98
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Expand Up @@ -11,7 +11,6 @@ linters:
- cyclop
- depguard
- dupl
- dupword
- errname
- errorlint
- exhaustive
Expand Down Expand Up @@ -43,7 +42,6 @@ linters:
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
- varnamelen
Expand Down
2 changes: 1 addition & 1 deletion bytesconv_test.go
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions client.go
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions fs.go
Expand Up @@ -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++
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion http_test.go
Expand Up @@ -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}
Expand Down

0 comments on commit 8ecfc98

Please sign in to comment.