Skip to content

Commit 1f10e86

Browse files
committed
review
1 parent ba785f8 commit 1f10e86

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

.golangci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ linters-settings:
2727
- ifElseChain
2828
- octalLiteral
2929
- whyNoLint
30-
- wrapperFunc
3130
gocyclo:
3231
min-complexity: 15
3332
goimports:

pkg/golinters/lll.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func getLLLIssuesForFile(filename string, maxLineLen int, tabSpaces string) ([]r
8888
scanner := bufio.NewScanner(f)
8989
for scanner.Scan() {
9090
line := scanner.Text()
91-
line = strings.Replace(line, "\t", tabSpaces, -1)
91+
line = strings.ReplaceAll(line, "\t", tabSpaces)
9292
lineLen := utf8.RuneCountInString(line)
9393
if lineLen > maxLineLen {
9494
res = append(res, result.Issue{

pkg/result/processors/path_shortener.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func (p PathShortener) Name() string {
3131
func (p PathShortener) Process(issues []result.Issue) ([]result.Issue, error) {
3232
return transformIssues(issues, func(i *result.Issue) *result.Issue {
3333
newI := i
34-
newI.Text = strings.Replace(newI.Text, p.wd+"/", "", -1)
35-
newI.Text = strings.Replace(newI.Text, p.wd, "", -1)
34+
newI.Text = strings.ReplaceAll(newI.Text, p.wd+"/", "")
35+
newI.Text = strings.ReplaceAll(newI.Text, p.wd, "")
3636
return newI
3737
}), nil
3838
}

test/errchk.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func errorCheck(outStr string, wantAuto bool, defaultWantedLinter string, fullsh
3333
for i := range out {
3434
for j := 0; j < len(fullshort); j += 2 {
3535
full, short := fullshort[j], fullshort[j+1]
36-
out[i] = strings.Replace(out[i], full, short, -1)
36+
out[i] = strings.ReplaceAll(out[i], full, short)
3737
}
3838
}
3939

test/testshared/testshared.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (r *LintRunner) RunCommandWithYamlConfig(cfg, command string, args ...strin
154154
}
155155

156156
cfg = strings.TrimSpace(cfg)
157-
cfg = strings.Replace(cfg, "\t", " ", -1)
157+
cfg = strings.ReplaceAll(cfg, "\t", " ")
158158

159159
err = os.WriteFile(cfgPath, []byte(cfg), os.ModePerm)
160160
assert.NoError(r.t, err)

0 commit comments

Comments
 (0)