PageRenderTime 32ms CodeModel.GetById 22ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/go/enum/runme.go

#
Go | 32 lines | 24 code | 7 blank | 1 comment | 0 complexity | 110d9dde8cc8149dcbc4ecc2c4cb7138 MD5 | raw file
 1package main
 2
 3import (
 4	"fmt"
 5	. "./example"
 6)
 7
 8func main() {
 9	// Print out the value of some enums
10	fmt.Println("*** color ***")
11	fmt.Println("    RED = ", RED)
12	fmt.Println("    BLUE = ", BLUE)
13	fmt.Println("    GREEN = ", GREEN)
14
15	fmt.Println("\n*** Foo::speed ***")
16	fmt.Println("    Foo::IMPULSE = ", FooIMPULSE)
17	fmt.Println("    Foo::WARP = ", FooWARP)
18	fmt.Println("    Foo::LUDICROUS = ", FooLUDICROUS)
19
20	fmt.Println("\nTesting use of enums with functions\n")
21
22	Enum_test(RED, FooIMPULSE)
23	Enum_test(BLUE, FooWARP)
24	Enum_test(GREEN, FooLUDICROUS)
25
26	fmt.Println("\nTesting use of enum with class method")
27	f := NewFoo()
28
29	f.Enum_test(FooIMPULSE)
30	f.Enum_test(FooWARP)
31	f.Enum_test(FooLUDICROUS)
32}