Merge pull request #199 from colincross/vet

Fix format issues found by go vet
This commit is contained in:
colincross 2018-02-23 14:23:17 -08:00 committed by GitHub
commit f12def88ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 {