summaryrefslogtreecommitdiff
path: root/kythe/go/indexer/testdata/basic/packageinit.go
blob: a19413e7adf0f9d52ab048f9084efd34f92a5c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Package pkginit tests callgraph relationships for calls occurring in the
// package-level initializer.
package pkginit

import "fmt"

// Ensure that callsites at the package level are blamed on the implicit
// package initializer, and that said initializer is given a sensible
// definition anchor per http://www.kythe.io/docs/schema/callgraph.html

// - A=@"fmt.Sprint(27)" ref/call _FmtSprint
// - A childof PkgInit=vname("package.<init>@107", "test", _, "pkginit", "go")
// - PkgInit.node/kind function
// -
// - InitDef=vname(_, "test", "", "pkginit/packageinit.go", "go")
// -     defines PkgInit
// - InitDef.node/kind anchor
// - InitDef.loc/start 0
// - InitDef.loc/end 0
var p = fmt.Sprint(27)