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

# · Go · 32 lines · 24 code · 7 blank · 1 comment · 0 complexity · 110d9dde8cc8149dcbc4ecc2c4cb7138 MD5 · raw file

  1. package main
  2. import (
  3. "fmt"
  4. . "./example"
  5. )
  6. func main() {
  7. // Print out the value of some enums
  8. fmt.Println("*** color ***")
  9. fmt.Println(" RED = ", RED)
  10. fmt.Println(" BLUE = ", BLUE)
  11. fmt.Println(" GREEN = ", GREEN)
  12. fmt.Println("\n*** Foo::speed ***")
  13. fmt.Println(" Foo::IMPULSE = ", FooIMPULSE)
  14. fmt.Println(" Foo::WARP = ", FooWARP)
  15. fmt.Println(" Foo::LUDICROUS = ", FooLUDICROUS)
  16. fmt.Println("\nTesting use of enums with functions\n")
  17. Enum_test(RED, FooIMPULSE)
  18. Enum_test(BLUE, FooWARP)
  19. Enum_test(GREEN, FooLUDICROUS)
  20. fmt.Println("\nTesting use of enum with class method")
  21. f := NewFoo()
  22. f.Enum_test(FooIMPULSE)
  23. f.Enum_test(FooWARP)
  24. f.Enum_test(FooLUDICROUS)
  25. }