Remove unnecessary conversions

pull/1121/head
Ville Skyttä 4 years ago
parent 7743265113
commit a9b1ce2dec

@ -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:

@ -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)

@ -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
}

Loading…
Cancel
Save