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:
Daniel Martí
2019-09-13 17:02:01 +01:00
committed by Elias Naur
parent 5bdb1d9e54
commit a223b36c25
+2 -2
View File
@@ -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))