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 - 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 - compiles the project
go build-o my-app ./

there - received launches binary
SERVICE_PID=$(ps-aux | awk '$11=="'$SERVICE'" {print $2}')

if [ -z $ACTION ]
 echo "Command not found"

if ! [ -x $SERVICE ]
 echo "Service execute permission not granted"

if [ $ACTION = 'start' ]
 if ! [ -z $SERVICE_PID ]
 echo "Service PID:{$SERVICE_PID}"
 nohup $SERVICE > log/$(date +%F-%H-%M-%S).log 2>&1 log/$(date +%F-%H-%M-%S).log 2>&1 
br><br>, my-app - should have the right to run: chmod +x*. <br><br> 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">./ ./ 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 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