Skip to content

Commit a24fc23

Browse files
committed
update staticcheck to v2020.1.3
full diff: dominikh/go-tools@2019.2.3...2020.1.3 Also updates two tests to accomodate updated rules: --- FAIL: TestSourcesFromTestdataWithIssuesDir/staticcheck.go (0.43s) linters_test.go:137: [run --disable-all --print-issued-lines=false --print-linter-name=false --out-format=line-number --max-same-issues=10 -Estaticcheck --no-config testdata/staticcheck.go] linters_test.go:33: Error Trace: linters_test.go:33 linters_test.go:138 linters_test.go:53 Error: Received unexpected error: staticcheck.go:11: no match for `self-assignment of x to x` vs ["SA4006: this value of `x` is never used"] in: staticcheck.go:11:2: SA4006: this value of `x` is never used unmatched errors staticcheck.go:11:2: SA4006: this value of `x` is never used Test: TestSourcesFromTestdataWithIssuesDir/staticcheck.go Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 76a82c6 commit a24fc23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+12294
-7862
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ require (
4646
github.com/valyala/quicktemplate v1.2.0
4747
golang.org/x/tools v0.0.0-20200204192400-7124308813f3
4848
gopkg.in/yaml.v2 v2.2.7
49-
honnef.co/go/tools v0.0.1-2019.2.3
49+
honnef.co/go/tools v0.0.1-2020.1.3
5050
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed
5151
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
5252
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f

go.sum

+3
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDq
340340
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
341341
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
342342
golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
343+
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
343344
golang.org/x/tools v0.0.0-20200102140908-9497f49d5709 h1:AfG1EmoRkFK24HWWLxSrRKNg2G+oA3JVOG8GJsHWypQ=
344345
golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
345346
golang.org/x/tools v0.0.0-20200119215504-eb0d8dd85bcc h1:ZA7KFRdqWZkBr0/YbHm1h08vDJ5gQdjVG/8L153z5c4=
@@ -379,6 +380,8 @@ gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
379380
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
380381
honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
381382
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
383+
honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
384+
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
382385
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I=
383386
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
384387
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo=

test/testdata/staticcheck.go

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
func Staticcheck() {
1010
var x int
1111
x = x // ERROR "self-assignment of x to x"
12+
fmt.Printf("%d", x)
1213
}
1314

1415
func StaticcheckNolintStaticcheck() {

test/testdata/staticcheck_in_megacheck.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
//args: -Emegacheck
22
package testdata
33

4+
import "fmt"
5+
46
func StaticcheckInMegacheck() {
57
var x int
68
x = x // ERROR "self-assignment of x to x"
9+
fmt.Printf("%d", x)
710
}
811

912
func StaticcheckNolintStaticcheckInMegacheck() {

vendor/honnef.co/go/tools/LICENSE-THIRD-PARTY

+59-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ resulting binaries. These projects are:
7575
limitations under the License.
7676

7777

78-
* github.com/kisielk/gotool https://github.com/kisielk/gotool
78+
* github.com/kisielk/gotool - https://github.com/kisielk/gotool
7979

8080
Copyright (c) 2013 Kamil Kisiel <[email protected]>
8181

@@ -224,3 +224,61 @@ resulting binaries. These projects are:
224224
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
225225
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
226226

227+
* gogrep - https://github.com/mvdan/gogrep
228+
229+
Copyright (c) 2017, Daniel Martí. All rights reserved.
230+
231+
Redistribution and use in source and binary forms, with or without
232+
modification, are permitted provided that the following conditions are
233+
met:
234+
235+
* Redistributions of source code must retain the above copyright
236+
notice, this list of conditions and the following disclaimer.
237+
* Redistributions in binary form must reproduce the above
238+
copyright notice, this list of conditions and the following disclaimer
239+
in the documentation and/or other materials provided with the
240+
distribution.
241+
* Neither the name of the copyright holder nor the names of its
242+
contributors may be used to endorse or promote products derived from
243+
this software without specific prior written permission.
244+
245+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
246+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
247+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
248+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
249+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
250+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
251+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
252+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
253+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
255+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
256+
257+
* gosmith - https://github.com/dvyukov/gosmith
258+
259+
Copyright (c) 2014 Dmitry Vyukov. All rights reserved.
260+
261+
Redistribution and use in source and binary forms, with or without
262+
modification, are permitted provided that the following conditions are
263+
met:
264+
265+
* Redistributions of source code must retain the above copyright
266+
notice, this list of conditions and the following disclaimer.
267+
* Redistributions in binary form must reproduce the above
268+
copyright notice, this list of conditions and the following disclaimer
269+
in the documentation and/or other materials provided with the
270+
distribution.
271+
* The name of Dmitry Vyukov may be used to endorse or promote
272+
products derived from this software without specific prior written permission.
273+
274+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
275+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
276+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
277+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
278+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
279+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
280+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
281+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
282+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
283+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
284+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)