aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/testdata/good/good1.go
diff options
context:
space:
mode:
Diffstat (limited to 'gopls/internal/lsp/testdata/good/good1.go')
-rw-r--r--gopls/internal/lsp/testdata/good/good1.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/gopls/internal/lsp/testdata/good/good1.go b/gopls/internal/lsp/testdata/good/good1.go
new file mode 100644
index 000000000..624d8147a
--- /dev/null
+++ b/gopls/internal/lsp/testdata/good/good1.go
@@ -0,0 +1,21 @@
+package good //@diag("package", "no_diagnostics", "", "error")
+
+import (
+ "golang.org/lsptests/types" //@item(types_import, "types", "\"golang.org/lsptests/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, CoolAlias)
+ _ = 0 // suppress "empty branch" diagnostic
+ }
+
+ return y
+}