Skip to content

Commit 8ecfc98

Browse files
authored
Enable dupword, unconvert linters (#1658)
1 parent 1834cec commit 8ecfc98

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

.golangci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ linters:
1111
- cyclop
1212
- depguard
1313
- dupl
14-
- dupword
1514
- errname
1615
- errorlint
1716
- exhaustive
@@ -43,7 +42,6 @@ linters:
4342
- testpackage
4443
- thelper
4544
- tparallel
46-
- unconvert
4745
- unparam
4846
- usestdlibvars
4947
- varnamelen

bytesconv_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestAppendHTMLEscape(t *testing.T) {
3737
allcases[i] = byte(i)
3838
}
3939
res := string(AppendHTMLEscape(nil, string(allcases)))
40-
expect := string(html.EscapeString(string(allcases)))
40+
expect := html.EscapeString(string(allcases))
4141
if res != expect {
4242
t.Fatalf("unexpected string %q. Expecting %q.", res, expect)
4343
}

client.go

+1
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,7 @@ func (c *HostClient) acquireConn(reqTimeout time.Duration, connectionClose bool)
14741474
return nil, ErrNoFreeConns
14751475
}
14761476

1477+
//nolint:dupword
14771478
// reqTimeout c.MaxConnWaitTimeout wait duration
14781479
// d1 d2 min(d1, d2)
14791480
// 0(not set) d2 d2

fs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ func (cm *inMemoryCacheManager) GetFileFromCache(cacheKind CacheKind, path strin
870870
fileCache := cm.getFsCache(cacheKind)
871871

872872
cm.cacheLock.Lock()
873-
ff, ok := fileCache[string(path)]
873+
ff, ok := fileCache[path]
874874
if ok {
875875
ff.readersCount++
876876
}
@@ -1594,7 +1594,7 @@ func (h *fsHandler) newFSFile(f fs.File, fileInfo fs.FileInfo, compressed bool,
15941594
}
15951595

15961596
func readFileHeader(f io.Reader, compressed bool, fileEncoding string) ([]byte, error) {
1597-
r := io.Reader(f)
1597+
r := f
15981598
var (
15991599
br *brotli.Reader
16001600
zr *gzip.Reader

http_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3022,7 +3022,7 @@ func TestResponseBodyStream(t *testing.T) {
30223022
}
30233023
})
30243024

3025-
t.Run("limit response body size size", func(t *testing.T) {
3025+
t.Run("limit response body size", func(t *testing.T) {
30263026
t.Parallel()
30273027

30283028
client := Client{StreamResponseBody: true, MaxResponseBodySize: 20}

0 commit comments

Comments
 (0)