Environmental introductory language to build the go

I. Introduction

GO is an open source programming language, which allows a simple structure, reliable, and efficient software easier. Reduce the amount of code to achieve a good high concurrency. This article is to build a small series GO environment in the windows system environment.

Second, build environment GO

1. Download go environment package:

Download the installation package official website address is:

https://golang.org/dl/

If you can not open this address:

https://golang.google.cn/dl/

Find the download version for your system, I downloaded the windows version, as shown below:

2. Install

Double-click the installation package installation, it has been basically completed next

 

 

3. Verify

In windows cmd window input go version, the version information appears I go in,

The installation is successful, as shown below:

 

 

Also in the input window cmd you can view the env go go arrangement, as shown below:

 

 

Image above:

GOROOT: installation directory go language.

GOPATH: working directory go language.

GOBIN: go Language installation bin directory that bin under GOROOT.

Third, install IDE (permanently activated) golang demo

1. Download the installation package

Permanently activated version of the download link:

https://shareappscrack.com/jetbrains-goland-2/

I downloaded the windows version, as shown below

 

2. Install

2.1 Double-installation package following interface:

 

 

Next click on the image above 2.2

 

 

nex 2.3 Click the image above, he appeared as shown below in the figure below according to their

Need to choose, I choose the following figure:

 

 

The installation is complete an online search for a secret key can be used to activate, and find Baidu crack tutorial, I bought the secret key.

 

create 2.13 Click the image above, into the main interface, as shown below,

 

 

 

Click on the new project, the following interface,

 

 

Location is my job to build their own space go, you can choose your own, GOROOT choose GO yuan more than the installation directory, my chart shown above.

4.2 Click Once you have created will enter into the main interface, called the demo project I have built

 

 

上图中,需要自己在demo下,新建bin,pkg,src文件夹,在src文件夹下新建main文件夹,在main文件夹新建HelloWord.go文件,目录及代码如上如所示。

4.3 接下来设置一下项目的GOROOT 以及 GOPATH 编译文件的生成地址等操作

打开FIle->Other settings->Preferences for New Projects

设置 GOROOT 为 Go 1.13.4

设置GOPATH 的Project GOPATH 为 demo,如下图所示

 

 

4.4 接下来设置output 和 working

点击run下edit configurations,如下图所示:

 

 

 

点击上图中的+号选择GO BUILD

 

 

出现下图界面

 

 

上图中的选中的地方就是需要配置的地方。

点击apply,完成配置,点击ok,关闭配置界面。

4.5 运行,选中如下图所示

 

 

运行成功之后控制台出现如下信息:

 

 

而且,可以看到在bin下生成了一个可运行的文件

 

 

以上是小编自己总结和实践的GO语言入门基础篇,有好多写的不周的地方请海涵,如果大家在实践过程中有任何问题,可以关注小编,留言与小编一起探讨。

Guess you like

Origin www.cnblogs.com/well-666/p/12196255.html