aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.go/methods.go
blob: 563d0e4930d44362425300f1a76424be2bb92900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

import "fmt"

type T struct { i int }

func (t T) Foo () {
  fmt.Println (t.i)
}

func (t *T) Bar () {
  fmt.Println (t.i)
}

func main () {
  fmt.Println ("Shall we?")
  var t T
  t.Foo ()
  var pt = new (T)
  pt.Bar ()
}