Skip to content

Instantly share code, notes, and snippets.

@codekoala
Created July 10, 2014 04:49
Show Gist options
  • Save codekoala/406b883932fec70e7adf to your computer and use it in GitHub Desktop.
Save codekoala/406b883932fec70e7adf to your computer and use it in GitHub Desktop.
Platform-specific code for Go. Simply run "go build" and run the resulting executable.
package main
func main() {
hiForPlatform()
}
package main
import "fmt"
func hiForPlatform() {
fmt.Println("Hello Linux!")
}
package main
import "fmt"
func hiForPlatform() {
fmt.Println("Hello Windows!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment