mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
16 lines
317 B
Go
16 lines
317 B
Go
package marshal
|
|
|
|
// FromUtsname reads the C-strings from syscall.Utsname and transforms them to Go
|
|
// strings
|
|
func FromUtsname(ca [65]uint8) string {
|
|
s := make([]byte, len(ca))
|
|
var lens int
|
|
for ; lens < len(ca); lens++ {
|
|
if ca[lens] == 0 {
|
|
break
|
|
}
|
|
s[lens] = uint8(ca[lens])
|
|
}
|
|
return string(s[0:lens])
|
|
}
|