Skip to content

Commit 4ce9a19

Browse files
build(deps): bump github.com/go-critic/go-critic from 0.5.6 to 0.6.0 (#2041)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent 6edca92 commit 4ce9a19

File tree

12 files changed

+33
-27
lines changed

12 files changed

+33
-27
lines changed

.github/workflows/codeql.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
2727
# TODO: Enable for javascript later
2828
language: [ 'go' ]
29+
golang: [ '1.16' ]
2930
# Learn more...
3031
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
3132

@@ -42,6 +43,11 @@ jobs:
4243
- run: git checkout HEAD^2
4344
if: ${{ github.event_name == 'pull_request' }}
4445

46+
- name: Install Go
47+
uses: actions/setup-go@v2
48+
with:
49+
go-version: ${{ matrix.golang }}
50+
4551
# Initializes the CodeQL tools for scanning.
4652
- name: Initialize CodeQL
4753
uses: github/codeql-action/init@v1
@@ -56,4 +62,4 @@ jobs:
5662
- run: make build test
5763

5864
- name: Perform CodeQL Analysis
59-
uses: github/codeql-action/analyze@v1
65+
uses: github/codeql-action/analyze@v1

.github/workflows/pr.yml

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666
strategy:
6767
matrix:
6868
golang:
69-
- 1.15
7069
- 1.16
7170
- 1.17
7271
steps:

.golangci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ linters-settings:
5050
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
5151
lll:
5252
line-length: 140
53-
maligned:
54-
suggest-new: true
5553
misspell:
5654
locale: US
5755
nolintlint:
@@ -117,6 +115,9 @@ linters:
117115
# - wsl
118116

119117
issues:
118+
exclude:
119+
# disable this rule for go1.15 compatibility
120+
- 'ioutilDeprecated:'
120121
# Excluding configuration per-path, per-linter, per-text and per-source
121122
exclude-rules:
122123
- path: _test\.go
@@ -141,7 +142,6 @@ issues:
141142
linters:
142143
- gomnd
143144

144-
145145
run:
146146
skip-dirs:
147147
- test/testdata_etc

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/golangci/golangci-lint
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a
@@ -21,7 +21,7 @@ require (
2121
github.com/esimonov/ifshort v1.0.2
2222
github.com/fatih/color v1.13.0
2323
github.com/fzipp/gocyclo v0.3.1
24-
github.com/go-critic/go-critic v0.5.6
24+
github.com/go-critic/go-critic v0.6.1
2525
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b
2626
github.com/gofrs/flock v0.8.1
2727
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2

go.sum

+8-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netlify.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[context.production.environment]
2-
GO_VERSION = "1.15"
2+
GO_VERSION = "1.16"
33

44
[context.deploy-preview.environment]
5-
GO_VERSION = "1.15"
5+
GO_VERSION = "1.16"
66

77
[context.branch-deploy.environment]
8-
GO_VERSION = "1.15"
8+
GO_VERSION = "1.16"

pkg/golinters/goanalysis/runner_loadingpackage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,6 @@ func sizeOfReflectValueTreeBytes(rv reflect.Value, visitedPtrs map[uintptr]struc
492492
case reflect.Invalid:
493493
return 0
494494
default:
495-
panic("unknown rv of type " + fmt.Sprint(rv))
495+
panic("unknown rv of type " + rv.String())
496496
}
497497
}

pkg/golinters/gocritic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func NewGocritic() *goanalysis.Linter {
3434
}
3535
return goanalysis.NewLinter(
3636
gocriticName,
37-
`Provides many diagnostics that check for bugs, performance and style issues.
37+
`Provides diagnostics that check for bugs, performance and style issues.
3838
Extensible without recompilation through dynamic rules.
3939
Dynamic rules are written declaratively with AST patterns, filters, report message and optional suggestion.`,
4040
[]*analysis.Analyzer{analyzer},

pkg/result/issue.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (i *Issue) Fingerprint() string {
9292
}
9393

9494
hash := md5.New() //nolint:gosec
95-
_, _ = hash.Write([]byte(fmt.Sprintf("%s%s%s", i.Pos.Filename, i.Text, firstLine)))
95+
_, _ = fmt.Fprintf(hash, "%s%s%s", i.Pos.Filename, i.Text, firstLine)
9696

9797
return fmt.Sprintf("%X", hash.Sum(nil))
9898
}

pkg/timeutils/stopwatch.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ const noStagesText = "no stages"
1515
type Stopwatch struct {
1616
name string
1717
startedAt time.Time
18-
stages map[string]time.Duration
1918
log logutils.Log
2019

21-
sync.Mutex
20+
stages map[string]time.Duration
21+
mu sync.Mutex
2222
}
2323

2424
func NewStopwatch(name string, log logutils.Log) *Stopwatch {
@@ -110,7 +110,7 @@ func (s *Stopwatch) TrackStage(name string, f func()) {
110110
startedAt := time.Now()
111111
f()
112112

113-
s.Lock()
113+
s.mu.Lock()
114114
s.stages[name] += time.Since(startedAt)
115-
s.Unlock()
115+
s.mu.Unlock()
116116
}

scripts/expand_website_templates/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func getLatestVersion() (string, error) {
136136
req, err := http.NewRequest( // nolint:noctx
137137
http.MethodGet,
138138
"https://api.github.com/repos/golangci/golangci-lint/releases/latest",
139-
nil,
139+
http.NoBody,
140140
)
141141
if err != nil {
142142
return "", fmt.Errorf("failed to prepare a http request: %s", err)
@@ -286,7 +286,7 @@ func check(b bool, title string) string {
286286
}
287287

288288
func span(title, icon string) string {
289-
return fmt.Sprintf(`<span title="%s">%s</span>`, title, icon)
289+
return fmt.Sprintf(`<span title=%q>%s</span>`, title, icon)
290290
}
291291

292292
func getThanksList() string {

scripts/gen_github_action_config/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/golangci/golangci-lint/scripts/gen_github_action_config
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/shurcooL/githubv4 v0.0.0-20200627185320-e003124d66e4

0 commit comments

Comments
 (0)