~vtuson/scopecreator/twitter-template

« back to all changes in this revision

Viewing changes to src/go/src/code.google.com/p/go.tools/go/pointer/testdata/hello.go

  • Committer: Victor Palau
  • Date: 2015-03-11 14:24:42 UTC
  • Revision ID: vtuson@gmail.com-20150311142442-f2pxp111c8ynv232
public release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 instrincally 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