Update gometalinter config (#331)
* Update gometalinter config gometalinter now uses `maligned` instead of `aligncheck` (https://github.com/alecthomas/gometalinter/pull/367), so we need to update our config accordingly. * Update gometalinter * Disable gotype linter gotype does not seem to play nicely with the gb vendor directory. In particular, it wants each of our dependencies to be built and installed (see https://github.com/golang/go/issues/10969), but (empirically) it will not accept them being installed in `pkg` but insists on them being in `vendor/pkg`. This presents a problem because `gb build` builds the packages into `pkg` (which doesn't seem entirely unreasonable since `.` comes before `vendor` in `$GOPATH`). `go install github.com/x/y` does install in `vendor/pkg` but requires us to know the name of each package. The general conclusion of https://github.com/alecthomas/gometalinter/issues/91 seems to have been that the easiest thing to do is to disable `gotype` for now. * Fix `unparam` lint * Fix goshadow lint
This commit is contained in:
parent
dc782ec399
commit
8fff0e887c
95 changed files with 8927 additions and 1176 deletions
29
vendor/src/github.com/alecthomas/gometalinter/regressiontests/nakedret_test.go
vendored
Normal file
29
vendor/src/github.com/alecthomas/gometalinter/regressiontests/nakedret_test.go
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package regressiontests
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNakedret(t *testing.T) {
|
||||
t.Parallel()
|
||||
source := `package test
|
||||
|
||||
func shortFunc() (r uint32) {
|
||||
r = r + r
|
||||
return
|
||||
}
|
||||
|
||||
func longFunc() (r uint32) {
|
||||
r = r + r
|
||||
r = r - r
|
||||
r = r * r
|
||||
r = r / r
|
||||
r = r % r
|
||||
r = r^r
|
||||
r = r&r
|
||||
return
|
||||
}
|
||||
`
|
||||
expected := Issues{
|
||||
{Linter: "nakedret", Severity: "warning", Path: "test.go", Line: 16, Message: "longFunc naked returns on 9 line function "},
|
||||
}
|
||||
ExpectIssues(t, "nakedret", source, expected)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue