github.com/v2fly/tools@v0.100.0/internal/lsp/testdata/bad/bad0.go (about) 1 // +build go1.11 2 3 package bad 4 5 import _ "github.com/v2fly/tools/internal/lsp/assign/internal/secret" //@diag("\"github.com/v2fly/tools/internal/lsp/assign/internal/secret\"", "compiler", "could not import github.com/v2fly/tools/internal/lsp/assign/internal/secret (invalid use of internal package github.com/v2fly/tools/internal/lsp/assign/internal/secret)", "error") 6 7 func stuff() { //@item(stuff, "stuff", "func()", "func") 8 x := "heeeeyyyy" 9 random2(x) //@diag("x", "compiler", "cannot use x (variable of type string) as int value in argument to random2", "error") 10 random2(1) //@complete("dom", random, random2, random3) 11 y := 3 //@diag("y", "compiler", "y declared but not used", "error") 12 } 13 14 type bob struct { //@item(bob, "bob", "struct{...}", "struct") 15 x int 16 } 17 18 func _() { 19 var q int 20 _ = &bob{ 21 f: q, //@diag("f: q", "compiler", "unknown field f in struct literal", "error") 22 } 23 }