mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 18:42:36 +00:00
hostinfo: use ByteSliceToString from golang.org/x/sys/unix
Use unix.ByteSliceToString in osVersionFreebsd and osVersionLinux to convert the Utsname.Release []byte field to string. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
2a61261a5a
commit
3a926348a4
@@ -27,12 +27,7 @@ func osVersionFreebsd() string {
|
||||
|
||||
var attrBuf strings.Builder
|
||||
attrBuf.WriteString("; version=")
|
||||
for _, b := range un.Release {
|
||||
if b == 0 {
|
||||
break
|
||||
}
|
||||
attrBuf.WriteByte(byte(b))
|
||||
}
|
||||
attrBuf.WriteString(unix.ByteSliceToString(un.Release[:]))
|
||||
attr := attrBuf.String()
|
||||
|
||||
version := "FreeBSD"
|
||||
|
Reference in New Issue
Block a user