Let's go together (2)

Source: Internet
Author: User

In the previous article, we first came into contact with the go language, configured the environment, and finally compiled and ran the first goProgram. Although there is no explanation of the syntax in the running program, this is not a worry for beginners, because we need to step by step, first implement something you don't know, and then explain it slowly, it may have a better effect than directly speaking a lot of syntaxes, and it is more impressive. Today, we have to continue to improve our preparations, because, in the previous article, we can see that our conditions are somewhat difficult andCodeAnd compile and run our program in the command line. Today, we have to improve our conditions as appropriate. That's right. Today we need to improve the development environment of the Go language. If you are always used to writing programs using notepad, I certainly have no objection, but a good editor or IDE is essential to improve development efficiency. Which Development and Integration environments are available for the go language?

 

1. Editor and IDE supporting go

The above title seems to express some problems (Hey, as long as you can edit, including notepad is also supported), in fact, I want to say that the editor and IDE support the syntax highlighting or smart prompt function. Currently, the following are available:

    • Bbedit and textwrangler, a syntax file is now also
      Included in the standard go distributionGo/MISC/bbedit/.
    • Eclipse plugins.
    • Intellij idea plugin.
    • Mcedit.
    • Scite.
    • Nano.
    • Notepad ++.
    • Sublimetext 2.
    • Vim-AutoComplete, alternative syntax files and other
      Extras.
    • Golangide
    • Gogo
    • ...

At first glance, there are quite a few, most of which are provided in the form of plug-ins, but today we want to install not the above, but go-ide Based on intellij transformation. If you are interested in all of the above, click here.Http://go-lang.cat-v.org/text-editors/ 
Today, we will only introduce how to install go-ide.

 

1. Download go-ide:

Http://go-ide.com/

2. After downloading the SDK, decompress the package and configure the JDK environment variables on the computer. JDK version officially recommended:

Java SE Development Kit 6 Update 26.

Add idea_jdk = Your JDK path to the environment variable (for example, D: \ Java \ jdk1.6.0 _ 26)

3. Run idea. bat in the bin directory of the decompressed folder. The running result is as follows:

 

2. Create a go project and compile and run it.

First, select File-> Create Project

 

Next, set the project name, path, and other information:

 

Next. Finally, select a go SDK. Generally, the Go SDK that comes with Go-Ide is selected by default. Finally, finish:

 

After creation, you can see the following project structure in the left-side resource window:

 

Right-click the src directory and create a new go application. Ide automatically generates a hello World Go program:

 

 

When you run the go program, an error is reported because you need to configure the run parameter:

 

Change the script path to the absolute path of the file you created.

Then run the program:

 

It looks successful ~

 

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.