-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
722 additions
and
537 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package chanrecv | ||
|
||
func ChanRecvOK() { | ||
_, ok := <-make(chan int) | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = ok | ||
} |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package conventional | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
) | ||
|
||
func Variable() { | ||
var ( | ||
ctx context.Context | ||
b *testing.B | ||
f *testing.F | ||
m *testing.M | ||
pb *testing.PB | ||
t *testing.T | ||
tb testing.TB | ||
) | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = ctx | ||
_ = b | ||
_ = f | ||
_ = m | ||
_ = pb | ||
_ = t | ||
_ = tb | ||
} | ||
|
||
func Param(ctx context.Context, | ||
b *testing.B, | ||
f *testing.F, | ||
m *testing.M, | ||
pb *testing.PB, | ||
t *testing.T, | ||
tb testing.TB) { | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = ctx | ||
_ = b | ||
_ = f | ||
_ = m | ||
_ = pb | ||
_ = t | ||
_ = tb | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package distance | ||
|
||
func Variable() { | ||
x := 123 | ||
_ = x | ||
} | ||
|
||
func Param(x int) { | ||
_ = x | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package warningsreceiver | ||
|
||
type foo struct{} | ||
|
||
func (f *foo) Receiver() { | ||
_ = f | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package distancereturn | ||
|
||
func Return() (x int) { | ||
x = 123 | ||
return | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package falsenegativechanrecv | ||
|
||
func ChanRecvOK_Name() { | ||
_, o := <-make(chan int) // want `variable name 'o' is too short for the scope of its usage` | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = o | ||
} | ||
|
||
func ChanRecvOK_Not2() { | ||
ok := <-make(chan int) // want `variable name 'ok' is too short for the scope of its usage` | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = ok | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package falsenegativemapindex | ||
|
||
func MapIndexOK_Name() { | ||
_, o := map[int]int{}[0] // want `variable name 'o' is too short for the scope of its usage` | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = o | ||
} | ||
|
||
func MapIndexOK_Not2() { | ||
ok := map[int]int{}[0] // want `variable name 'ok' is too short for the scope of its usage` | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = ok | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package falsenegativetypeassert | ||
|
||
func TypeAssertOK_Name() { | ||
_, o := interface{}(1).(int) // want `variable name 'o' is too short for the scope of its usage` | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = o | ||
} | ||
|
||
func TypeAssertOK_Not2() { | ||
ok := interface{}(1).(int) // want `variable name 'ok' is too short for the scope of its usage` | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
// fill | ||
_ = ok | ||
} |
Oops, something went wrong.