mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
cmd/gio: don't use stderr output from the go tool
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+6
-4
@@ -56,12 +56,14 @@ func main() {
|
|||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
// Expand relative package paths.
|
// Expand relative package paths.
|
||||||
out, err := exec.Command("go", "list", pkg).CombinedOutput()
|
out, err := exec.Command("go", "list", pkg).Output()
|
||||||
out = bytes.TrimSpace(out)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorf("gio: %s", out)
|
if err, ok := err.(*exec.ExitError); ok {
|
||||||
|
errorf("gio: %s", bytes.TrimSpace(err.Stderr))
|
||||||
|
}
|
||||||
|
errorf("gio: failed to run the go tool: %v", err)
|
||||||
}
|
}
|
||||||
pkg = string(out)
|
pkg = string(bytes.TrimSpace(out))
|
||||||
appArgs := flag.Args()[1:]
|
appArgs := flag.Args()[1:]
|
||||||
if err := run(pkg, appArgs); err != nil {
|
if err := run(pkg, appArgs); err != nil {
|
||||||
errorf("gio: %v", err)
|
errorf("gio: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user