-
as a library in Go code
package main import ( "encoding/json" "fmt" "os" platformOS "github.com/codemodify/systemkit-platform-os" ) func main() { data, err := json.Marshal(platformOS.Info()) if err != nil { fmt.Println(err.Error()) } if len(os.Args) > 1 && os.Args[1] == "-p" { data, err = json.MarshalIndent(platformOS.Info(), "", " ") if err != nil { fmt.Println(err.Error()) } } if fmt.Println(string(data)) if osInfo.Name == platformOS.OS_Linux { fmt.Println("WE ARE ON Linux") fmt.Println("Distro: ", osInfo.Distribution) } else if platformOS.IsBSD(osInfo.Name) { fmt.Println("WE ARE ON BSD family") } else if platformOS.IsDarwin(osInfo.Name) { fmt.Println("WE ARE ON WINDOWS family") } else if platformOS.IsWindows(osInfo.Name) { fmt.Println("WE ARE ON WINDOWS family") } }
-
as a binary on a a bunch of platforms
-
Notifications
You must be signed in to change notification settings - Fork 1
License
codemodify/systemkit-platform-os
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published
