github.com/criteo/command-launcher@v0.0.0-20230407142452-fb616f546e98/test/get-os.go (about) 1 package main 2 3 import ( 4 "fmt" 5 "os" 6 "runtime" 7 ) 8 9 func main() { 10 args := os.Args[1:] 11 if len(args) == 0 { 12 fmt.Println(runtime.GOOS) 13 os.Exit(0) 14 } 15 16 if args[0] == "extension" { 17 if runtime.GOOS == "windows" { 18 fmt.Println(".exe") 19 } else { 20 fmt.Println("") 21 } 22 } 23 }