all: address vet issues, fix print calls

This fixes some print calls with wrong format directives. Additionally,
struct initialisers were changed to use keyed fields, purely to reduce
the amount of noise generated by go vet.

Change-Id: Ib9f6fd8f2dff7ce84826478de0ba83dda9746270
Reviewed-on: https://go-review.googlesource.com/21180
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/cmd/bundle/main.go b/cmd/bundle/main.go
index 5f38e35..962ccd0 100644
--- a/cmd/bundle/main.go
+++ b/cmd/bundle/main.go
@@ -151,7 +151,7 @@
 		wd, _ := os.Getwd()
 		pkg, err := build.ImportDir(wd, 0)
 		if err != nil {
-			log.Fatal("cannot find package in current directory: %v", err)
+			log.Fatalf("cannot find package in current directory: %v", err)
 		}
 		*dstPath = pkg.ImportPath
 		if *pkgName == "" {
diff --git a/cmd/cover/cover.go b/cmd/cover/cover.go
index 31ec434..e093364 100644
--- a/cmd/cover/cover.go
+++ b/cmd/cover/cover.go
@@ -374,7 +374,7 @@
 			}
 		}
 		if list != nil {
-			comments = append(comments, &ast.CommentGroup{list})
+			comments = append(comments, &ast.CommentGroup{List: list})
 		}
 	}
 	return comments
diff --git a/cmd/guru/describe.go b/cmd/guru/describe.go
index 2bec552..b6ce632 100644
--- a/cmd/guru/describe.go
+++ b/cmd/guru/describe.go
@@ -448,7 +448,7 @@
 	// Show sizes for structs and named types (it's fairly obvious for others).
 	switch t.(type) {
 	case *types.Named, *types.Struct:
-		szs := types.StdSizes{8, 8} // assume amd64
+		szs := types.StdSizes{WordSize: 8, MaxAlign: 8} // assume amd64
 		description = fmt.Sprintf("%s (size %d, align %d)", description,
 			szs.Sizeof(t), szs.Alignof(t))
 	}
diff --git a/go/gcimporter15/bexport_test.go b/go/gcimporter15/bexport_test.go
index 941f751..81a1154 100644
--- a/go/gcimporter15/bexport_test.go
+++ b/go/gcimporter15/bexport_test.go
@@ -166,7 +166,7 @@
 			xm := x.Method(i)
 			ym := y.Method(i)
 			if xm.Name() != ym.Name() {
-				return fmt.Errorf("mismatched %th method: %s vs %s", i, xm, ym)
+				return fmt.Errorf("mismatched %dth method: %s vs %s", i, xm, ym)
 			}
 			if err := equalType(xm.Type(), ym.Type()); err != nil {
 				return fmt.Errorf("mismatched %s method: %s", xm.Name(), err)
@@ -175,7 +175,7 @@
 	case *types.Array:
 		y := y.(*types.Array)
 		if x.Len() != y.Len() {
-			return fmt.Errorf("unequal array lengths: %d vs %d", x, y)
+			return fmt.Errorf("unequal array lengths: %d vs %d", x.Len(), y.Len())
 		}
 		if err := equalType(x.Elem(), y.Elem()); err != nil {
 			return fmt.Errorf("array elements: %s", err)
@@ -188,7 +188,7 @@
 	case *types.Chan:
 		y := y.(*types.Chan)
 		if x.Dir() != y.Dir() {
-			return fmt.Errorf("unequal channel directions: %s vs %s", x.Dir(), y.Dir())
+			return fmt.Errorf("unequal channel directions: %d vs %d", x.Dir(), y.Dir())
 		}
 		if err := equalType(x.Elem(), y.Elem()); err != nil {
 			return fmt.Errorf("channel elements: %s", err)
@@ -263,7 +263,7 @@
 	case *types.Tuple:
 		y := y.(*types.Tuple)
 		if x.Len() != y.Len() {
-			return fmt.Errorf("unequal tuple lengths: %d vs %d", x, y)
+			return fmt.Errorf("unequal tuple lengths: %d vs %d", x.Len(), y.Len())
 		}
 		for i := 0; i < x.Len(); i++ {
 			if err := equalType(x.At(i).Type(), y.At(i).Type()); err != nil {
diff --git a/go/loader/loader.go b/go/loader/loader.go
index 1ed0d3e..f0171fc 100644
--- a/go/loader/loader.go
+++ b/go/loader/loader.go
@@ -899,7 +899,7 @@
 				// (Also it would complicate the
 				// invariants of importPath completion.)
 				if trace {
-					fmt.Fprintln(os.Stderr, "import cycle: %q", cycle)
+					fmt.Fprintf(os.Stderr, "import cycle: %q\n", cycle)
 				}
 				continue
 			}
diff --git a/go/ssa/interp/interp_test.go b/go/ssa/interp/interp_test.go
index 5163816..70c2f40 100644
--- a/go/ssa/interp/interp_test.go
+++ b/go/ssa/interp/interp_test.go
@@ -251,7 +251,7 @@
 	interp.CapturedOutput = &out
 
 	hint = fmt.Sprintf("To trace execution, run:\n%% go build golang.org/x/tools/cmd/ssadump && ./ssadump -build=C -run --interp=T %s\n", input)
-	exitCode := interp.Interpret(mainPkg, 0, &types.StdSizes{8, 8}, inputs[0], []string{})
+	exitCode := interp.Interpret(mainPkg, 0, &types.StdSizes{WordSize: 8, MaxAlign: 8}, inputs[0], []string{})
 
 	// The definition of success varies with each file.
 	if err := success(exitCode, out.String()); err != nil {
diff --git a/godoc/analysis/typeinfo.go b/godoc/analysis/typeinfo.go
index 1ccff52..5796a852 100644
--- a/godoc/analysis/typeinfo.go
+++ b/godoc/analysis/typeinfo.go
@@ -34,7 +34,7 @@
 // TODO(adonovan): audit to make sure it's safe on ill-typed packages.
 
 // TODO(adonovan): use same Sizes as loader.Config.
-var sizes = types.StdSizes{8, 8}
+var sizes = types.StdSizes{WordSize: 8, MaxAlign: 8}
 
 func (a *analysis) doTypeInfo(info *loader.PackageInfo, implements map[*types.Named]implementsFacts) {
 	// We must not assume the corresponding SSA packages were
diff --git a/oracle/describe.go b/oracle/describe.go
index 70ddacf..3be32df 100644
--- a/oracle/describe.go
+++ b/oracle/describe.go
@@ -442,7 +442,7 @@
 	// Show sizes for structs and named types (it's fairly obvious for others).
 	switch t.(type) {
 	case *types.Named, *types.Struct:
-		szs := types.StdSizes{8, 8} // assume amd64
+		szs := types.StdSizes{WordSize: 8, MaxAlign: 8} // assume amd64
 		description = fmt.Sprintf("%s (size %d, align %d)", description,
 			szs.Sizeof(t), szs.Alignof(t))
 	}