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

@@ -60,7 +60,7 @@ func coreDump(dir string) {
// I wish there was a better way to get the master IP...
config, err := loadConfig()
if err != nil {
fmt.Printf("Error loading config: %v")
fmt.Printf("Error loading config: %v", err)
}
ix := strings.LastIndex(config.Host, "/")
master := net.JoinHostPort(config.Host[ix+1:], "22")

View File

@@ -77,7 +77,7 @@ func gcloudListNodes() {
output, err := exec.Command("gcloud", "compute", "instances", "list",
"--project="+testContext.CloudConfig.ProjectID, "--zone="+testContext.CloudConfig.Zone).CombinedOutput()
if err != nil {
Logf("Failed to list nodes: %v, %v", err)
Logf("Failed to list nodes: %v", err)
return
}
Logf(string(output))

View File

@@ -550,7 +550,7 @@ var _ = Describe("Nodes", func() {
pod, err := c.Pods(ns).Get(additionalPod)
Expect(err).NotTo(HaveOccurred())
if pod.Spec.NodeName != node.Name {
Logf("Pod %s found on invalid node: %s instead of %s", pod.Spec.NodeName, node.Name)
Logf("Pod %s found on invalid node: %s instead of %s", pod.Name, pod.Spec.NodeName, node.Name)
}
}
})

View File

@@ -1267,7 +1267,7 @@ func testNotReachable(ip string, port int) {
Logf("Expecting %s to be unreachable but was reachable and got an error reading response: %v", url, err)
return false, nil
}
Logf("Able to reach service %s when should no longer have been reachable, status:%d and body: %s", url, resp.Status, string(body))
Logf("Able to reach service %s when should no longer have been reachable, status: %q and body: %s", url, resp.Status, string(body))
return false, nil
})
Expect(err).NotTo(HaveOccurred(), "Error waiting for %s", desc)

View File

@@ -1813,7 +1813,7 @@ func resetMetrics(c *client.Client) error {
return err
}
if string(body) != "metrics reset\n" {
return fmt.Errorf("Unexpected response: ", string(body))
return fmt.Errorf("Unexpected response: %q", string(body))
}
return nil
}