mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
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 {
|
switch *target {
|
||||||
case "ios", "tvos", "android", "js":
|
case "ios", "tvos", "android", "js":
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("invalid -target %s\n", *target)
|
return fmt.Errorf("invalid -target %s", *target)
|
||||||
}
|
}
|
||||||
switch *buildMode {
|
switch *buildMode {
|
||||||
case "archive", "exe":
|
case "archive", "exe":
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("invalid -buildmode %s\n", *buildMode)
|
return fmt.Errorf("invalid -buildmode %s", *buildMode)
|
||||||
}
|
}
|
||||||
// Find package name.
|
// Find package name.
|
||||||
pkgPath, err := runCmd(exec.Command("go", "list", "-f", "{{.ImportPath}}", pkg))
|
pkgPath, err := runCmd(exec.Command("go", "list", "-f", "{{.ImportPath}}", pkg))
|
||||||
|
|||||||
Reference in New Issue
Block a user