// +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
}

// +build linux freebsd openbsd darwin solaris

package host

import (
	"golang.org/x/sys/unix"
)

func kernelArch() (string, error) {
	var utsname unix.Utsname
	err := unix.Uname(&utsname)
	return string(utsname.Machine[:]), err
}

--- 
+++ 
@@ -3,11 +3,13 @@
 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[:]), err
+	return string(utsname.Machine[:bytes.IndexByte(utsname.Machine[:], 0)]), err
 }
Trim null bytes from kernel arch