您可能想在此处使用屏幕等虚拟终端实用程序。例子:screen -S myapp # create screen with name myappcd ... # to your app directorygo run myapp.go # or go install and then ./myappfrom go bin dirCtrl-a+d # to go out of screen如果要返回屏幕:screen -r myapp编辑:当您离开终端时,此解决方案将保留该过程,但在崩溃时不会重新启动它。