github.com/v2fly/tools@v0.100.0/go/pointer/testdata/hello.go (about)

     1  // +build ignore
     2  
     3  package main
     4  
     5  import (
     6  	"fmt"
     7  	"os"
     8  )
     9  
    10  type S int
    11  
    12  var theS S
    13  
    14  func (s *S) String() string {
    15  	print(s) // @pointsto main.theS
    16  	return ""
    17  }
    18  
    19  func main() {
    20  	// os.Args is considered intrinsically allocated,
    21  	// but may also be set explicitly (e.g. on Windows), hence '...'.
    22  	print(os.Args) // @pointsto <command-line args> | ...
    23  	fmt.Println("Hello, World!", &theS)
    24  }
    25  
    26  // @calls main.main               -> fmt.Println
    27  // @calls (*fmt.pp).handleMethods -> (*main.S).String