Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matishsiao/goInfo
get os information use golang
https://github.com/matishsiao/goInfo
Last synced: 28 days ago
JSON representation
get os information use golang
- Host: GitHub
- URL: https://github.com/matishsiao/goInfo
- Owner: matishsiao
- License: mit
- Created: 2014-06-09T05:59:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-02-04T18:41:22.000Z (almost 3 years ago)
- Last Synced: 2024-02-15T10:33:42.921Z (10 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 121
- Watchers: 6
- Forks: 45
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- cybersecurity-golang-security - goinfo - get os information use golang (System Information)
- awesome-go-security - goinfo - get os information use golang (System Information)
README
# Introduction:
GoInfo is get os platform information coding by Golang.
It can help you to know os information.
## Version:version:0.0.1
## Futures
get linux information
get windows information
get osx information
get freebsd information
## Install:
```sh
go get github.com/matishsiao/goInfo
go build
```## Struct:
```go
type GoInfoObject struct {
GoOS string
Kernel string
Core string
Platform string
OS string
Hostname string
CPUs int
}
```## Example:
```go
package mainimport (
"github.com/matishsiao/goInfo"
)func main() {
gi, _ := goInfo.GetInfo()
gi.VarDump()
}
}
```It's will show:
```
GoOS: linux
Kernel: Linux
Core: 3.13.0-27-generic
Platform: x86_64
OS: GNU/Linux
Hostname: ubuntu
CPUs: 1
```##License and Copyright
This software is Copyright 2012-2014 Matis Hsiao.