diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 |
commit | 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (patch) | |
tree | dd2a1ddf0476664c2b823409c36cbccd52662ca7 /packages/Python/lldbsuite/test/lang/go/types/main.go | |
parent | 3bd2e91faeb9eeec1aae82c64a3253afff551cfd (diff) | |
download | src-503acc3a0a1fd9a610f1a126b8608cb84b185170.tar.gz src-503acc3a0a1fd9a610f1a126b8608cb84b185170.zip |
Vendor import of lldb trunk r256945:vendor/lldb/lldb-trunk-r256945
Diffstat (limited to 'packages/Python/lldbsuite/test/lang/go/types/main.go')
-rw-r--r-- | packages/Python/lldbsuite/test/lang/go/types/main.go | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/lang/go/types/main.go b/packages/Python/lldbsuite/test/lang/go/types/main.go new file mode 100644 index 000000000000..c74650721d7d --- /dev/null +++ b/packages/Python/lldbsuite/test/lang/go/types/main.go @@ -0,0 +1,47 @@ +package main + +import "fmt" + +type Fooer interface { + Foo() int +} + +type SomeFooer struct { + val int +} + +func (s SomeFooer) Foo() int { + return s.val +} + +type mystruct struct { + myInt int + myPointer *mystruct +} + +func main() { + theBool := true + theInt := -7 + theComplex := 1 + 2i + pointee := -10 + thePointer := &pointee + theStruct := &mystruct { myInt: 7} + theStruct.myPointer = theStruct + theArray := [5]byte{1, 2, 3, 4, 5} + theSlice := theArray[1:2] + theString := "abc" + + f := SomeFooer {9} + var theEface interface{} = f + var theFooer Fooer = f + + theChan := make(chan int) + theMap := make(map[int]string) + theMap[1] = "1" + + fmt.Println(theBool) // Set breakpoint here. + // Reference all the variables so the compiler is happy. + fmt.Println(theInt, theComplex, thePointer, theStruct.myInt) + fmt.Println(theArray[0], theSlice[0], theString) + fmt.Println(theEface, theFooer, theChan, theMap) +}
\ No newline at end of file |