Correcting all go vet errors

This commit is contained in:
Kris Rousey
2015-08-07 18:52:23 -07:00
parent 9fdd793555
commit 565189f5b8
118 changed files with 285 additions and 298 deletions

View File

@@ -124,7 +124,7 @@ func (c *Repair) RunOnce() error {
util.HandleError(fmt.Errorf("the cluster IP %s for service %s/%s is not within the service CIDR %s; please recreate", ip, svc.Name, svc.Namespace, c.network))
case ipallocator.ErrFull:
// TODO: send event
return fmt.Errorf("the service CIDR %s is full; you must widen the CIDR in order to create new services")
return fmt.Errorf("the service CIDR %v is full; you must widen the CIDR in order to create new services", r)
default:
return fmt.Errorf("unable to allocate cluster IP %s for service %s/%s due to an unknown error, exiting: %v", ip, svc.Name, svc.Namespace, err)
}

View File

@@ -19,9 +19,10 @@ package portallocator
import (
"testing"
"strconv"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/util"
"strconv"
)
func TestAllocate(t *testing.T) {
@@ -42,10 +43,10 @@ func TestAllocate(t *testing.T) {
}
count++
if !pr.Contains(p) {
t.Fatalf("allocated %s which is outside of %s", p, pr)
t.Fatalf("allocated %d which is outside of %v", p, pr)
}
if found.Has(strconv.Itoa(p)) {
t.Fatalf("allocated %s twice @ %d", p, count)
t.Fatalf("allocated %d twice @ %d", p, count)
}
found.Insert(strconv.Itoa(p))
}
@@ -65,7 +66,7 @@ func TestAllocate(t *testing.T) {
t.Fatal(err)
}
if released != p {
t.Errorf("unexpected %s : %s", p, released)
t.Errorf("unexpected %d : %d", p, released)
}
if err := r.Release(released); err != nil {
@@ -139,7 +140,7 @@ func TestSnapshot(t *testing.T) {
for _, n := range ports {
if !other.Has(n) {
t.Errorf("restored range does not have %s", n)
t.Errorf("restored range does not have %d", n)
}
}
if other.Free() != r.Free() {