I have a GO application, which at some point executes os.Exit(1) because of an error that happens, the problem is that it is closing my terminal as well, not only terminating the app.
I am calling the application like this application --param1 1
How can I prevent that the application will not close my terminal and how can I get the exit status from it?
errexitshell option in your shell before running the application? You should be able to check whether this option is set withset -o | grep errexit. If it's set, the shell would exit if the application returns a non-zero exit status.