Commit | Line | Data |
---|---|---|
a766d390 DE |
1 | package main |
2 | ||
3 | import "fmt" | |
4 | ||
5 | type T struct { i int } | |
6 | ||
7 | func (t T) Foo () { | |
8 | fmt.Println (t.i) | |
9 | } | |
10 | ||
11 | func (t *T) Bar () { | |
12 | fmt.Println (t.i) | |
13 | } | |
14 | ||
15 | func main () { | |
16 | fmt.Println ("Shall we?") | |
17 | var t T | |
18 | t.Foo () | |
19 | var pt = new (T) | |
20 | pt.Bar () | |
21 | } |