1
0
mirror of https://github.com/golang/go synced 2024-10-01 16:28:33 -06:00
go/internal/lsp/testdata/godef/a/random.go
Ian Cottrell 6dfe7efaa9 internal/lsp: add definition tests from godef
This makes our internal version of go to definition be tested with the
same test data that godef now uses

Change-Id: I04e488b6b9b2d891181f202ea1125b823a079c50
Reviewed-on: https://go-review.googlesource.com/c/150045
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2018-11-19 18:17:22 +00:00

24 lines
384 B
Go

package a
func Random() int { //@Random
y := 6 + 7
return y
}
func Random2(y int) int { //@Random2,mark(RandomParamY, "y")
return y //@godef("y", RandomParamY)
}
type Pos struct {
x, y int //@mark(PosX, "x"),mark(PosY, "y")
}
func (p *Pos) Sum() int { //@mark(PosSum, "Sum")
return p.x + p.y //@godef("x", PosX)
}
func _() {
var p Pos
_ = p.Sum() //@godef("()", PosSum)
}