github.com/serversong/goreporter@v0.0.0-20200325104552-3cfaf44fd178/linters/golint/testdata/blank-import-lib.go (about)

     1  // Test that blank imports in library packages are flagged.
     2  
     3  // Package foo ...
     4  package foo
     5  
     6  // The instructions need to go before the imports below so they will not be
     7  // mistaken for documentation.
     8  
     9  /* MATCH /blank import/ */
    10  import _ "encoding/json"
    11  
    12  import (
    13  	"fmt"
    14  
    15  	/* MATCH /blank import/ */
    16  	_ "os"
    17  
    18  	/* MATCH /blank import/ */
    19  	_ "net/http"
    20  	_ "path"
    21  )
    22  
    23  import _ "encoding/base64" // Don't gripe about this
    24  
    25  import (
    26  	// Don't gripe about these next two lines.
    27  	_ "compress/zlib"
    28  	_ "syscall"
    29  
    30  	/* MATCH /blank import/ */
    31  	_ "path/filepath"
    32  )
    33  
    34  import (
    35  	"go/ast"
    36  	_ "go/scanner" // Don't gripe about this or the following line.
    37  	_ "go/token"
    38  )
    39  
    40  var (
    41  	_ fmt.Stringer // for "fmt"
    42  	_ ast.Node     // for "go/ast"
    43  )