github.com/april1989/origin-go-tools@v0.0.32/cmd/guru/testdata/src/referrers-json/main.go (about)

     1  package main
     2  
     3  // Tests of 'referrers' query.
     4  // See go.tools/guru/guru_test.go for explanation.
     5  // See referrers.golden for expected query results.
     6  
     7  import "lib"
     8  
     9  type s struct {
    10  	f int
    11  }
    12  
    13  func main() {
    14  	var v lib.Type = lib.Const // @referrers ref-package "lib"
    15  	_ = v.Method               // @referrers ref-method "Method"
    16  	_ = v.Method
    17  	v++ //@referrers ref-local "v"
    18  	v++
    19  
    20  	_ = s{}.f // @referrers ref-field "f"
    21  
    22  	var s2 s
    23  	s2.f = 1
    24  }