Fix format issues found by go vet

Test: m checkbuild
Change-Id: I5135e0daecd20abce9a66631f5f55230168613de
This commit is contained in:
Colin Cross 2018-02-23 10:55:25 -08:00
parent 759bb61dd5
commit c1d878159c
4 changed files with 7 additions and 7 deletions

View file

@ -52,7 +52,7 @@ func (m *multiArg) Get() interface{} {
}
func usage() {
fmt.Fprintf(os.Stderr, "usage: bpglob -o out glob\n")
fmt.Fprintln(os.Stderr, "usage: bpglob -o out glob")
flag.PrintDefaults()
os.Exit(2)
}
@ -61,7 +61,7 @@ func main() {
flag.Parse()
if *out == "" {
fmt.Fprintf(os.Stderr, "error: -o is required\n")
fmt.Fprintln(os.Stderr, "error: -o is required")
usage()
}

View file

@ -42,7 +42,7 @@ func usage() {
func usageViolation(violation string) {
fmt.Fprintln(os.Stderr, violation)
fmt.Fprintf(os.Stderr, "usage: bpfmt [flags] [path ...]\n")
fmt.Fprintln(os.Stderr, "usage: bpfmt [flags] [path ...]")
flag.PrintDefaults()
os.Exit(2)
}

View file

@ -48,7 +48,7 @@ func report(err error) {
}
func usage() {
fmt.Fprintf(os.Stderr, "usage: bpmodify [flags] [path ...]\n")
fmt.Fprintln(os.Stderr, "usage: bpmodify [flags] [path ...]")
flag.PrintDefaults()
os.Exit(2)
}

View file

@ -81,13 +81,13 @@ func TestBadPackagePathMap(t *testing.T) {
t.Error("Expected error with blank argument, but none returned")
}
if err := pkgMap.Set("a=a"); err != nil {
t.Error("Unexpected error: %v", err)
t.Errorf("Unexpected error: %v", err)
}
if err := pkgMap.Set("a=b"); err == nil {
t.Error("Expected error with duplicate package prefix, but none returned")
}
if _, ok, err := pkgMap.Path("testing"); err != nil {
t.Error("Unexpected error: %v", err)
t.Errorf("Unexpected error: %v", err)
} else if ok {
t.Error("Expected testing to be consider in the stdlib")
}
@ -104,7 +104,7 @@ func TestSingleBuild(t *testing.T) {
pkg := loadPkg()
if err := pkg.Compile(config, filepath.Join(dir, "out")); err != nil {
t.Fatalf("Got error when compiling:", err)
t.Fatal("Got error when compiling:", err)
}
if err := pkg.Link(config, out); err != nil {