How to run golang

(*-*)浩
Release: 2019-12-31 09:53:38
Original
4466 people have browsed it

How to run golang

There are two execution methods of Go language, one is to execute after compilation, and the other is to execute directly by go run.

1. Compile first and then execute It will compile an .exe executable file under Windows. If it is Linux or Mac, then there will be no suffix and it will still be an executable file) --->Execution output result 2. Directly execute go run

.go file (source code) on the source code ---> The underlying compilation and running is hidden (so the speed here is slightly slower than compilation) ---> Execution output result

The difference between the two execution methods

①: If we compile and generate an executable file first, then we can copy the file to a computer without go development

②: If we execute go run directly, then if we want to run on another machine, we also need a go development environment, otherwise it cannot be executed.

③: During compilation, the compiler will include the library files that the program depends on in the executable file, and the executable file will become larger.

The above is the detailed content of How to run golang. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!