-
Notifications
You must be signed in to change notification settings - Fork 265
/
blank-import-lib.go
49 lines (36 loc) 路 1.14 KB
/
blank-import-lib.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Test that blank imports in library packages are flagged.
// Package foo ...
package foo
// The instructions need to go before the imports below so they will not be
// mistaken for documentation.
import _ "encoding/json"
/* MATCH:9 /a blank import should be only in a main or test package, or have a comment justifying it/ */
import (
"fmt"
_ "os"
/* MATCH:16 /a blank import should be only in a main or test package, or have a comment justifying it/ */
_ "net/http"
/* MATCH:19 /a blank import should be only in a main or test package, or have a comment justifying it/ */
_ "path"
)
import _ "encoding/base64" // Don't gripe about this
import (
// Don't gripe about these next two lines.
_ "compress/zlib"
_ "syscall"
/* MATCH:30 /a blank import should be only in a main or test package, or have a comment justifying it/ */
_ "path/filepath"
)
import (
"go/ast"
_ "go/scanner" // Don't gripe about this or the following line.
_ "go/token"
)
import (
_ "embed"
/* MATCH:42 /a blank import should be only in a main or test package, or have a comment justifying it/ */
)
var (
_ fmt.Stringer // for "fmt"
_ ast.Node // for "go/ast"
)