Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phuurl/osinfo
Go package to return information on the current platform/OS
https://github.com/phuurl/osinfo
Last synced: 8 days ago
JSON representation
Go package to return information on the current platform/OS
- Host: GitHub
- URL: https://github.com/phuurl/osinfo
- Owner: Phuurl
- License: mit
- Created: 2022-02-12T18:03:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-01T21:47:58.000Z (over 2 years ago)
- Last Synced: 2024-12-29T16:46:08.392Z (12 days ago)
- Language: Go
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# osinfo
Go library to detect OS information of the platform it is running on.## Install
`go get github.com/Phuurl/osinfo`## Supported operating systems
`osinfo` will return information about the following supported OSs:
- Linux (kernel info for all, distro information required an `/etc/os-release` file)
- macOS
- Windows## Example
`osinfo.GetOsInfo()` returns an `osinfo.Info` struct, which looks like this when run on a Linux system (converted to JSON here for ease):```json
{
"GOOS": "linux",
"GOARCH": "arm64",
"Details": {
"Name": "Ubuntu",
"Version": "20.04",
"Build": "5.11.0-1028-aws"
}
}
```For more information on usage and the different returns for the different supported OSs, please see the [GoDocs](https://pkg.go.dev/github.com/Phuurl/osinfo).