Skip to content

Instantly share code, notes, and snippets.

@junxie6
Last active July 13, 2016 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junxie6/319058bc25af1317600404daf8e90fe3 to your computer and use it in GitHub Desktop.
Save junxie6/319058bc25af1317600404daf8e90fe3 to your computer and use it in GitHub Desktop.
determine operating system type
package main
import (
"log"
"runtime"
)
// Reference: http://stackoverflow.com/questions/19847594/how-to-reliably-detect-os-platform-in-go
func main() {
log.Printf("%v\n", runtime.GOOS) // output windows or linux
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment