From c1d878159c6ee53026fd4f7f42a9d2b1f4780037 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 23 Feb 2018 10:55:25 -0800 Subject: [PATCH] Fix format issues found by go vet Test: m checkbuild Change-Id: I5135e0daecd20abce9a66631f5f55230168613de --- bootstrap/bpglob/bpglob.go | 4 ++-- bpfmt/bpfmt.go | 2 +- bpmodify/bpmodify.go | 2 +- microfactory/microfactory_test.go | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bootstrap/bpglob/bpglob.go b/bootstrap/bpglob/bpglob.go index cb6633b..1097760 100644 --- a/bootstrap/bpglob/bpglob.go +++ b/bootstrap/bpglob/bpglob.go @@ -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() } diff --git a/bpfmt/bpfmt.go b/bpfmt/bpfmt.go index ba4d9b3..17fe513 100644 --- a/bpfmt/bpfmt.go +++ b/bpfmt/bpfmt.go @@ -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) } diff --git a/bpmodify/bpmodify.go b/bpmodify/bpmodify.go index 6a3c803..446034b 100644 --- a/bpmodify/bpmodify.go +++ b/bpmodify/bpmodify.go @@ -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) } diff --git a/microfactory/microfactory_test.go b/microfactory/microfactory_test.go index 083c9a6..8356adf 100644 --- a/microfactory/microfactory_test.go +++ b/microfactory/microfactory_test.go @@ -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 {