1
0
mirror of https://github.com/golang/go synced 2024-10-01 15:58:33 -06:00
go/internal/lsp/testdata/good/good1.go
Rohan Challa 7124308813 internal/lsp/tests: add severity parameter to @diag markers
This change will add another parameter to the diagnostic markers (@diag).

Change-Id: I69f4672e7d5417099c11d1a46d9bc45a4d1e5ecc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/217719
Run-TryBot: Rohan Challa <rohan@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-02-04 19:24:00 +00:00

22 lines
869 B
Go

package good //@diag("package", "no_diagnostics", "", "error")
import (
_ "go/ast" //@prepare("go/ast", "_", "_")
"golang.org/x/tools/internal/lsp/types" //@item(types_import, "types", "\"golang.org/x/tools/internal/lsp/types\"", "package")
)
func random() int { //@item(good_random, "random", "func() int", "func")
_ = "random() int" //@prepare("random", "", "")
y := 6 + 7 //@prepare("7", "", "")
return y //@prepare("return", "","")
}
func random2(y int) int { //@item(good_random2, "random2", "func(y int) int", "func"),item(good_y_param, "y", "int", "var")
//@complete("", good_y_param, types_import, good_random, good_random2, good_stuff)
var b types.Bob = &types.X{} //@prepare("ypes","types", "types")
if _, ok := b.(*types.X); ok { //@complete("X", X_struct, Y_struct, Bob_interface)
}
return y
}