How many ways are there to run go app as a background program?

hi everyone
I have a problem with go run in the background, I already using “tmux” for run go app and it’s have not any problem at the time but after 4 or 5 hours it’s (go run main.go) getting stopped automatically.
It seems like u pushed ctrl + c

I did go build in my os and uploaded to the server then use ./src into “tmux”(I going out properly of “tmux”)

Could you please give me any solution to prevent this problem?

Thanks in advance.

Try to handle the errors and log your actions. If your program stop unexpected probably is a panic there.

I already have “error log” files. as I can see I haven’t any error and when stopped go app it’s don’t have any error, it does not have a print error in terminal

This usually happens under some conditions that make an unhandled error return as if it were the signal to shut down the program.

Please make sure you handle all returned errors through your program.

There is a tool that helps you with that. goreturn was its name IIRC.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.