How to upload the application to Go in production?

Hello! Learning golang, made its first app on the local computer. Computer on windows, accordingly when you do go to build it I forms .exe file, and as it is on ubuntu 16.04 to get to work? As far as I know in ubuntu you can't run .exe. Then when the local launch it remains hanging in the terminal, on production I would like that it was a background process (such as nginx).

Actually a question as all it to organize? You links to read, thanks
June 10th 19 at 15:53
4 answers
June 10th 19 at 15:55
How to run a web server on the go? - I found these answers, if you have something to add write here the answers count
If you are training and not the real thing then here is the manual from scratch with configuring the server finishhim.ru/nginx-golang - Abdullah commented on June 10th 19 at 15:58
nginx for go it is not particularly necessary.
The extra layer. Without nginx go faster.
And static not much slower given. - marcelina.Goyette commented on June 10th 19 at 16:01
June 10th 19 at 15:57
Gather under another OS:

env GOOS=target-OS GOARCH=target-architecture go build package-import-path

Well, it's only for Linux, is there an analogue of env on Windows - I don't know, but you can just variables in the session set.

Starting services in ubuntu is using systemd - what? - times on Google.
June 10th 19 at 16:01
1. on the server need to deliver the source code of the project on the Go, if CI/CD using git, or, well, FTP

2. do the same go build - get a binary which you can run

in their projects (OS, Windows, servers, Linux) do things like this:

there build.sh - compiles the project
go build-o my-app ./

there service.sh - received launches binary
ACTION=$1
SERVICE="./my-app"
SERVICE_PID=$(ps-aux | awk '$11=="'$SERVICE'" {print $2}')

if [ -z $ACTION ]
then
 echo "Command not found"
exit;
fi

if ! [ -x $SERVICE ]
then
 echo "Service execute permission not granted"
exit;
fi

if [ $ACTION = 'start' ]
then
 if ! [ -z $SERVICE_PID ]
then
 echo "Service PID:{$SERVICE_PID}"
else
 nohup $SERVICE > log/$(date +%F-%H-%M-%S).log 2>&1 log/$(date +%F-%H-%M-%S).log 2>&1 
br><br> build.sh, service.sh my-app - should have the right to run: chmod +x*. <br><br> service.sh runs in the background that prints to stdout write to ./log/ - because the folder ./log should be created resp.write<br><br> procedure:<br><pre><code class="bash">./build.sh ./service.sh restart # start - net start-up, stop - kills process</code></pre><br><br> something like<br><br> by the way you can use nginx, but the config there.to register on the ACC.the port or unix socket .. a lot of different ways.
And why this script? Init.d services have already sunk into oblivion.
There are also systemd - Abdullah commented on June 10th 19 at 16:04

Find more questions by tags Go