swig/Examples/go/enum/runme.go
Ian Lance Taylor 7aafe3d8b2 Fix all Go tests to build with "go build"
Tested against Go 1.6 through Go 1.13beta1, and gccgo.

Fixes #1607
2019-08-08 14:30:50 -07:00

33 lines
714 B
Go

package main
import (
"fmt"
. "swigtests/example"
)
func main() {
// Print out the value of some enums
fmt.Println("*** color ***")
fmt.Println(" RED = ", RED)
fmt.Println(" BLUE = ", BLUE)
fmt.Println(" GREEN = ", GREEN)
fmt.Println("\n*** Foo::speed ***")
fmt.Println(" Foo::IMPULSE = ", FooIMPULSE)
fmt.Println(" Foo::WARP = ", FooWARP)
fmt.Println(" Foo::LUDICROUS = ", FooLUDICROUS)
fmt.Println("\nTesting use of enums with functions\n")
Enum_test(RED, FooIMPULSE)
Enum_test(BLUE, FooWARP)
Enum_test(GREEN, FooLUDICROUS)
fmt.Println("\nTesting use of enum with class method")
f := NewFoo()
f.Enum_test(FooIMPULSE)
f.Enum_test(FooWARP)
f.Enum_test(FooLUDICROUS)
}