go-openvpn
go-openvpn copied to clipboard
Proxy exit codes then CI tools runs subcommands
See ci/commands/utils.go -> MustRunCommand()
This command should proxy all data from runned command:
- output
- error output
- exit code https://kev.inburke.com/kevin/proxying-to-a-subcommand-with-go/
Good example then exit code is not propagated is:
go run ci/main.go test
2018/09/24 15:22:23 exit status 2
exit status 1
There might be an issue with os.Exit() in golang in general. All it does is print the exit status, but the return code you're getting is always 1.
Here's an example program:
package main
import (
"os"
)
func main() {
os.Exit(55)
}
Running it you get the following result:

So if the goal is to exit with the same status code - it might not be possible.
Looks like that only go run return exit 1: https://github.com/golang/go/issues/13440
If you building it and starting binary everything is fine:

sorry for this huge screenshot 😕
Did Mage solve this problem of proxying output? If so, lets close issue