Elements. Build native projects for any modern development platform, using the language(s) of your choice. Oxygene (Object Pascal), C#, Swift, Java, Go. | RemObjects Software

switch

Language: Gold, Platform: Echoes, Category: Tour of Go
https://github.com/remobjects/ElementsSamples/tree/master/Gold/Echoes/Tour of Go/switch

  • switch.Echoes
    • References
      • #
    • Source Files
    • Other Files

switch.go

// Ignored build directive: +build OMIT

package main

import (
	"fmt"
	"runtime"
)

func main() {
	fmt.Print("Go runs on ")
	switch os := runtime.GOOS; os {
	case "darwin":
		fmt.Println("OS X.")
	case "linux":
		fmt.Println("Linux.")
	default:
		// freebsd, openbsd,
		// plan9, windows...
		fmt.Printf("%s.\n", os)
	}
}