Fix golint failures of util/bandwith/*.go

This commit is contained in:
viegasdom
2019-04-11 14:17:08 +01:00
parent c2254cf19a
commit 1c468bf2e2
30 changed files with 482 additions and 118 deletions

View File

@@ -44,6 +44,7 @@ type tcShaper struct {
iface string
}
// NewTCShaper makes a new tcShaper for the given interface
func NewTCShaper(iface string) BandwidthShaper {
shaper := &tcShaper{
e: exec.New(),
@@ -157,10 +158,9 @@ func (t *tcShaper) findCIDRClass(cidr string) (classAndHandleList [][]string, fo
// filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1
if len(parts) != 19 {
return classAndHandleList, false, fmt.Errorf("unexpected output from tc: %s %d (%v)", filter, len(parts), parts)
} else {
resultTmp := []string{parts[18], parts[9]}
classAndHandleList = append(classAndHandleList, resultTmp)
}
resultTmp := []string{parts[18], parts[9]}
classAndHandleList = append(classAndHandleList, resultTmp)
}
}
if len(classAndHandleList) > 0 {