1 Star 0 Fork 0

Genius / gopsutil

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
host_posix.go 280 Bytes
Copy Edit Raw Blame History
Aman Gupta authored 2019-08-12 13:32 . Trim null bytes from kernel arch
// +build linux freebsd openbsd darwin solaris
package host
import (
"bytes"
"golang.org/x/sys/unix"
)
func kernelArch() (string, error) {
var utsname unix.Utsname
err := unix.Uname(&utsname)
return string(utsname.Machine[:bytes.IndexByte(utsname.Machine[:], 0)]), err
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/genius_jiao/gopsutil.git
git@gitee.com:genius_jiao/gopsutil.git
genius_jiao
gopsutil
gopsutil
v2.20.7

Search

344bd9b3 5694891 D2dac590 5694891