Go under Windows Build environment

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

Want to lazy but not, the experimental building has 1 hours of environmental restrictions, build go to build environment.
Host system: Win7 32bit

Download go under https://golang.org/dl/, I downloaded go1.8.3.windows-386.zip.


Paste_image.png


Extract to the appropriate file directory (C:\MyProgram), add the environment variables, in the environment variable path to add C:\MyProgram\bin; new environment variable goroot, content is C:\MyProgram; new environment variable Gopath, Content is a project path for the Go language development.
Enter go env on the command line to view the GO environment variable settings, results


Paste_image.png


The environment for this go has been set up.

In order to facilitate the programming, further build the environment.
1, install Vim (also can not install, use UltraEdit, nodepad++ and so on editor, even can use Notepad), download Vim http://www.vim.org/download.php#pc, and then install. For ease of use, add Vim's path C:\Program files\vim\vim80\ to the environment variable path.
2, modify the Vim configuration, display line number. Modify the user rights of the C:\Program FILES\VIM_VIMRC, and then add a row of set number to the file


Paste_image.png


3, finally can create a new text file on the desktop, named Go.bat. The content is cmd/k "cd/d D:\Workspace\Go" so you can go to the go working directory directly.

Environmental testing:
1, dual-machine desktop Go.bat, enter the working directory.
2. New Folder MD Hello, and enter CD Hello
3. Create a new file and edit Vim Hello.go
4. After saving, run go run hello.go
Under another DOS use DIR to view directories and files, rd Delete empty folders, del delete files, return to parent directory CD ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.