What is the simplest way to run a go server in the background? I currently have the server running in CMD and would rather not change the actual code.
I'd use a screen. Assuming Ubuntu 18.04:
sudo apt-get install screen
Then
screen
Then
go run main.go
Use Ctrl + A + D to get out of the screen. To return to it:
screen -r