Explorar el Código

Merge pull request #28538 from yongtang/11162016-Log-Logf-fix

Fix several issues with `go vet` and `gofmt -s`
Brian Goff hace 8 años
padre
commit
22dccaf2d6

+ 2 - 2
cli/command/formatter/container_test.go

@@ -372,7 +372,7 @@ func TestContainerContextWriteJSONField(t *testing.T) {
 }
 }
 
 
 func TestContainerBackCompat(t *testing.T) {
 func TestContainerBackCompat(t *testing.T) {
-	containers := []types.Container{types.Container{ID: "brewhaha"}}
+	containers := []types.Container{{ID: "brewhaha"}}
 	cases := []string{
 	cases := []string{
 		"ID",
 		"ID",
 		"Names",
 		"Names",
@@ -390,7 +390,7 @@ func TestContainerBackCompat(t *testing.T) {
 	for _, c := range cases {
 	for _, c := range cases {
 		ctx := Context{Format: Format(fmt.Sprintf("{{ .%s }}", c)), Output: buf}
 		ctx := Context{Format: Format(fmt.Sprintf("{{ .%s }}", c)), Output: buf}
 		if err := ContainerWrite(ctx, containers); err != nil {
 		if err := ContainerWrite(ctx, containers); err != nil {
-			t.Log("could not render template for field '%s': %v", c, err)
+			t.Logf("could not render template for field '%s': %v", c, err)
 			t.Fail()
 			t.Fail()
 		}
 		}
 		buf.Reset()
 		buf.Reset()

+ 1 - 1
cli/command/stack/list.go

@@ -72,7 +72,7 @@ func printTable(out io.Writer, stacks []*stack) {
 
 
 type stack struct {
 type stack struct {
 	// Name is the name of the stack
 	// Name is the name of the stack
-	Name     string
+	Name string
 	// Services is the number of the services
 	// Services is the number of the services
 	Services int
 	Services int
 }
 }

+ 2 - 2
daemon/commit.go

@@ -240,8 +240,8 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
 	}
 	}
 
 
 	attributes := map[string]string{
 	attributes := map[string]string{
-		"comment": c.Comment,
-		"imageID": id.String(),
+		"comment":  c.Comment,
+		"imageID":  id.String(),
 		"imageRef": imageRef,
 		"imageRef": imageRef,
 	}
 	}
 	daemon.LogContainerEventWithAttributes(container, "commit", attributes)
 	daemon.LogContainerEventWithAttributes(container, "commit", attributes)

+ 1 - 1
volume/volume_test.go

@@ -254,7 +254,7 @@ func TestParseMountSpec(t *testing.T) {
 			t.Fatalf("Expected mount source to match. Expected: '%s', Actual: '%s'", c.expected.Source, mp.Source)
 			t.Fatalf("Expected mount source to match. Expected: '%s', Actual: '%s'", c.expected.Source, mp.Source)
 		}
 		}
 		if c.expected.RW != mp.RW {
 		if c.expected.RW != mp.RW {
-			t.Fatalf("Expected mount writable to match. Expected: '%v', Actual: '%s'", c.expected.RW, mp.RW)
+			t.Fatalf("Expected mount writable to match. Expected: '%v', Actual: '%v'", c.expected.RW, mp.RW)
 		}
 		}
 		if c.expected.Propagation != mp.Propagation {
 		if c.expected.Propagation != mp.Propagation {
 			t.Fatalf("Expected mount propagation to match. Expected: '%v', Actual: '%s'", c.expected.Propagation, mp.Propagation)
 			t.Fatalf("Expected mount propagation to match. Expected: '%v', Actual: '%s'", c.expected.Propagation, mp.Propagation)