mitranim / gow

Missing watch mode for Go commands. Watch Go files and execute a command like "go run" or "go test"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

subcommand error: exit status 2

marcosvidolin opened this issue · comments

The command is executed fine but Im getting this issue after the execution of all comands:

[gow] subcommand error: exit status 2

Go version go1.18.5 darwin/amd64

Thanks

Apologies for slow response. If you still have this problem, I need specific examples of commands you're running and full terminal output from them.

hey no problem...

command:

gow test ./...

output example:

ok  	gowtest	0.167s
[gow] subcommand error: signal: terminated
--- FAIL: TestSum (0.00s)
    main_test.go:9:
FAIL
FAIL	gowtest	0.568s
FAIL
[gow] subcommand error: exit status 1

Sounds like expected behavior. gow tells you that the subcommand go test exited with non-zero status, indicating a problem, which in this case is a failing test. This only happens when using gow's -v flag.

But I'm not using -v flag for the test

This only happens when using gow's -v flag.

This part was fake news. Even without -v, when the subcommand exits with a non-nil error, gow prints that error. In case of test failures, go test exits with a non-zero code, which causes "os/exec".Cmd to generate a non-nil error, which is printed by gow.

gow already suppresses this particular error message for go run. It makes sense to also suppress it for go test, which always prints failure messages, making this redundant. Fixed in 2cffced.