forked from joejulian/gio
cmd/gio: avoid a trailing newline in -target errors
I was seeing an extra newline when some errors were printed, like: $ gio foo please specify target $ The source of the little bug was a trailing newline in the error messages. Printing the messages already adds a newline. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
This commit is contained in:
+2
-2
@@ -66,12 +66,12 @@ func mainErr() error {
|
||||
switch *target {
|
||||
case "ios", "tvos", "android", "js":
|
||||
default:
|
||||
return fmt.Errorf("invalid -target %s\n", *target)
|
||||
return fmt.Errorf("invalid -target %s", *target)
|
||||
}
|
||||
switch *buildMode {
|
||||
case "archive", "exe":
|
||||
default:
|
||||
return fmt.Errorf("invalid -buildmode %s\n", *buildMode)
|
||||
return fmt.Errorf("invalid -buildmode %s", *buildMode)
|
||||
}
|
||||
// Find package name.
|
||||
pkgPath, err := runCmd(exec.Command("go", "list", "-f", "{{.ImportPath}}", pkg))
|
||||
|
||||
Reference in New Issue
Block a user