2020-02-04 08:41:36 -07:00
|
|
|
package good //@diag("package", "no_diagnostics", "", "error")
|
2018-10-29 16:12:41 -06:00
|
|
|
|
2018-11-13 09:13:53 -07:00
|
|
|
import (
|
2019-08-22 11:31:03 -06:00
|
|
|
_ "go/ast" //@prepare("go/ast", "_", "_")
|
2020-02-03 23:09:33 -07:00
|
|
|
"golang.org/x/tools/internal/lsp/types" //@item(types_import, "types", "\"golang.org/x/tools/internal/lsp/types\"", "package")
|
2018-11-13 09:13:53 -07:00
|
|
|
)
|
|
|
|
|
2019-07-02 16:10:05 -06:00
|
|
|
func random() int { //@item(good_random, "random", "func() int", "func")
|
2019-08-22 11:31:03 -06:00
|
|
|
_ = "random() int" //@prepare("random", "", "")
|
|
|
|
y := 6 + 7 //@prepare("7", "", "")
|
|
|
|
return y //@prepare("return", "","")
|
2018-10-29 16:12:41 -06:00
|
|
|
}
|
|
|
|
|
2019-09-24 22:46:57 -06:00
|
|
|
func random2(y int) int { //@item(good_random2, "random2", "func(y int) int", "func"),item(good_y_param, "y", "int", "var")
|
2018-11-13 09:13:53 -07:00
|
|
|
//@complete("", good_y_param, types_import, good_random, good_random2, good_stuff)
|
2019-08-22 11:31:03 -06:00
|
|
|
var b types.Bob = &types.X{} //@prepare("ypes","types", "types")
|
2019-06-26 16:30:01 -06:00
|
|
|
if _, ok := b.(*types.X); ok { //@complete("X", X_struct, Y_struct, Bob_interface)
|
2018-11-13 09:13:53 -07:00
|
|
|
}
|
|
|
|
|
2018-10-29 16:12:41 -06:00
|
|
|
return y
|
|
|
|
}
|