Make scope build on arm.

This commit is contained in:
Tom Wilkie
2015-10-09 11:03:22 +00:00
parent 81d927fd35
commit aab15cd5f5
3 changed files with 28 additions and 12 deletions

View File

@@ -12,18 +12,6 @@ import (
// Uname is swappable for mocking in tests.
var Uname = syscall.Uname
func charsToString(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])
}
// GetKernelVersion returns the kernel version as reported by uname.
var GetKernelVersion = func() (string, error) {
var utsname syscall.Utsname

View File

@@ -0,0 +1,15 @@
// +build !arm
package host
func charsToString(ca [65]int8) 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])
}

View File

@@ -0,0 +1,13 @@
package host
func charsToString(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])
}