V
V
v- death2015-08-14 10:34:32
go
v- death, 2015-08-14 10:34:32

How to start compilation?

I probably already got you with my questions, but since there are no Russian language docks and I don’t know English well, I’m afraid that I didn’t understand the docks correctly, so I’ll ask you again.
First of all, I need to set the gopath (the folder with the project, am I right?), then in the terminal go to the folder with the file that needs to be compiled and executed.
go build main.go
If something is wrong here, please correct it.
And now everything that I did not understand from the docks
All libraries will also fall into the binary?
Under what OS will this miracle work? (They write that you need to set flags when compiling for each OS, but I still haven’t figured it out).
If I transfer the binary to another ubuntu server and in nginx I do proxying like ip_server:port will it work?
Thanks everyone for the replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
index0h, 2015-08-14
@vGrabko99

By design: each directory is a separate package (optional, but highly recommended).
To compile - go to the directory with the main function of the main package. The command you provided is correct.
That's right, you get 1 binary at the output.
under the current one.
see: https://github.com/davecheney/golang-crosscompile
Too vague. The OS must be of the same family, the bitness must be the same, the dependent components must be the same (for example, you use memcache hard on port 11211, the same should be on the second system).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question