]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/lang/go/runtime/main.go
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / lang / go / runtime / main.go
1 package main
2
3 import "fmt"
4
5 type Fooer interface {
6         Foo() int
7 }
8
9 type SomeFooer struct {
10         val int
11 }
12
13 func (s SomeFooer) Foo() int {
14         return s.val
15 }
16
17 type AnotherFooer struct {
18     a, b, c int
19 }
20
21 func (s AnotherFooer) Foo() int {
22         return s.a
23 }
24
25
26 func printEface(a, b, c, d interface{}) {
27     fmt.Println(a, b, c, d)  // Set breakpoint 1
28 }
29
30 func printIface(a, b Fooer) {
31     fmt.Println(a, b)  // Set breakpoint 2
32 }
33 func main() {
34     sf := SomeFooer{9}
35     af := AnotherFooer{-1, -2, -3}
36     printEface(1,2.0, sf, af)
37     printIface(sf, af)
38 }