diff --git a/internal/common/binary.go b/internal/common/binary.go index 9b5dc55..bf385fd 100644 --- a/internal/common/binary.go +++ b/internal/common/binary.go @@ -253,7 +253,7 @@ func Write(w io.Writer, order ByteOrder, data interface{}) error { b[0] = *v case uint8: bs = b[:1] - b[0] = byte(v) + b[0] = v case []uint8: bs = v case *int16: diff --git a/internal/common/common.go b/internal/common/common.go index f1e4154..fe01b98 100644 --- a/internal/common/common.go +++ b/internal/common/common.go @@ -165,7 +165,7 @@ func UintToString(orig []uint8) string { size = i break } - ret[i] = byte(o) + ret[i] = o } if size == -1 { size = len(orig) diff --git a/internal/common/common_linux.go b/internal/common/common_linux.go index ea153de..7dc53c4 100644 --- a/internal/common/common_linux.go +++ b/internal/common/common_linux.go @@ -26,8 +26,8 @@ func DoSysctrl(mib string) ([]string, error) { return []string{}, err } v := strings.Replace(string(out), "{ ", "", 1) - v = strings.Replace(string(v), " }", "", 1) - values := strings.Fields(string(v)) + v = strings.Replace(v, " }", "", 1) + values := strings.Fields(v) return values, nil }