xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.go/methods.go (revision 4c3eb207d36f67d31994830c0a694161fc1ca39b)
1package main
2
3import "fmt"
4
5type T struct { i int }
6
7func (t T) Foo () {
8  fmt.Println (t.i)
9}
10
11func (t *T) Bar () {
12  fmt.Println (t.i)
13}
14
15func main () {
16  fmt.Println ("Shall we?")
17  var t T
18  t.Foo ()
19  var pt = new (T)
20  pt.Bar ()
21}
22