Last active
July 13, 2016 22:54
-
-
Save junxie6/319058bc25af1317600404daf8e90fe3 to your computer and use it in GitHub Desktop.
determine operating system type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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