-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: deprecate varcheck, deadcode, and structcheck (#3125)
- Loading branch information
Showing
13 changed files
with
66 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
package testdata | ||
|
||
var nolintUnknownLinter1 bool //nolint:bad1,deadcode,varcheck,megacheck | ||
import "math" | ||
|
||
//nolint:bad2,deadcode,megacheck | ||
func nolintUnknownLinter2() { | ||
func RetErr() error { | ||
return nil | ||
} | ||
|
||
func MissedErrorCheck() { | ||
RetErr() //nolint:bad1,errcheck | ||
} | ||
|
||
//nolint:bad2,errcheck | ||
func MissedErrorCheck2() { | ||
RetErr() | ||
} | ||
|
||
func _() { | ||
x := math.MinInt8 | ||
for { | ||
_ = x | ||
x = 0 //nolint:bad1,ineffassign | ||
x = 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
//nolint: varcheck | ||
//nolint:errcheck | ||
package testdata | ||
|
||
var nolintVarcheck int | ||
func RetError() error { | ||
return nil | ||
} | ||
|
||
func MissedErrorCheck1() { | ||
RetErr() | ||
} | ||
|
||
func jo(v, w bool) bool { | ||
return v == w || v == w | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//golangcitest:args -Edeadcode | ||
//golangcitest:args -Edeadcode --internal-cmd-test | ||
package testdata | ||
|
||
var y int | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//golangcitest:args -Evarcheck | ||
//golangcitest:args -Evarcheck --internal-cmd-test | ||
package testdata | ||
|
||
var v string // want "`v` is unused" |