Debian Codegraph @

staticcheck/sa1019/testdata/go1.0/CheckDeprecated/CheckDeprecated_test.go

raw
1 package pkg
2
3 import "testing"
4
5 // Deprecated: deprecating tests is silly but possible.
6 func TestFoo(t *testing.T) {
7 var s S
8 // Internal tests can use deprecated objects from the package they test.
9 _ = s.Field
10 }
11
12 // This test isn't deprecated, to test that s.Field doesn't get flagged because it's from the package under test. If
13 // TestBar was itself deprecated, it could use any deprecated objects it wanted.
14 func TestBar(t *testing.T) {
15 var s S
16 // Internal tests can use deprecated objects from the package under test
17 _ = s.Field
18 }