Debian Codegraph @

gopls/internal/test/marker/testdata/diagnostics/issue56943.txt

raw
1 This test verifies that we produce diagnostics related to mismatching
2 unexported interface methods in non-workspace packages.
3
4 Previously, we would fail to produce a diagnostic because we trimmed the AST.
5 See golang/go#56943.
6 -- settings.json --
7 {
8 "pullDiagnostics": true
9 }
10
11 -- main.go --
12 package main
13
14 import (
15 "go/ast"
16 "go/token"
17 )
18
19 func main() {
20 var a int //@diag(re"(a) int", re"declared.*not used")
21 var _ ast.Expr = node{} //@diag("node{}", re"missing.*exprNode")
22 }
23
24 type node struct{}
25
26 func (node) Pos() token.Pos { return 0 }
27 func (node) End() token.Pos { return 0 }