From 2a61261a5a438d8ed5520568f519a3b0a93ba34e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 1 Jun 2022 12:38:14 +0200 Subject: [PATCH] hostinfo: use Uname from golang.org/x/sys/unix in osVersionLinux As already done in osVersionFreebsd. This will allow to use the Utsname fields as []byte for easier conversion to string. Signed-off-by: Tobias Klauser --- hostinfo/hostinfo_linux.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hostinfo/hostinfo_linux.go b/hostinfo/hostinfo_linux.go index 90ceece90..a659490b9 100644 --- a/hostinfo/hostinfo_linux.go +++ b/hostinfo/hostinfo_linux.go @@ -13,7 +13,6 @@ import ( "io/ioutil" "os" "strings" - "syscall" "tailscale.com/util/lineread" "tailscale.com/version/distro" @@ -68,8 +67,8 @@ func osVersionLinux() string { return nil }) - var un syscall.Utsname - syscall.Uname(&un) + var un unix.Utsname + unix.Uname(&un) var attrBuf strings.Builder attrBuf.WriteString("; kernel=")