-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathos_specific.go
37 lines (34 loc) · 1018 Bytes
/
os_specific.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"fmt"
"runtime"
)
// OSCheck checks the operating system for OS specific functionality
func OSCheck() (string, string) {
// OS Check run for running compatible commands
// WIP
//OS := ""
pathPrefix := ""
switch runtime.GOOS {
case "windows":
//ver, err := syscall.GetVersion()
//if err != nil {
// panic(err)
//}
//Major := int(ver & 0xFF)
//Minor := int(ver >> 8 & 0xFF)
//Build := int(ver >> 16)
//OS = "windows"
fmt.Printf("Running on Windows %d Build: %d | Arch: %s | CPU(s): %d\n", 0, 0, runtime.GOARCH, runtime.NumCPU()) //!WIP
pathPrefix = ".\\"
case "linux":
fmt.Printf("Running on Linux '%s' | Ver: %s | Arch: %s | CPU(s): %d\n", "Ubuntu/Fedora/Whatever", "verTBD", runtime.GOARCH, runtime.NumCPU())
//OS = "linux"
pathPrefix = "./"
case "darwin":
fmt.Printf("Running on Mac OS '%s' | Ver: %s | Arch: %s | CPU(s): %d\n", "?", "verTBD", runtime.GOARCH, runtime.NumCPU())
//OS = "darwin"
pathPrefix = "./"
}
return pathPrefix, runtime.GOOS
}