Ubuntu Eclipse writes a simple Go language

Source: Internet
Author: User
Tags gocode
This is a creation in Article, where the information may have evolved or changed.

1, download configuration Golang, configure the relevant environment

One, now address: Http://www.golangtc.com/download I chose the following (64-bit, Linux version)

Second, the configuration environment

Configure environment variables in. BASHRC after decompression

2, Configuration Gocode

By default, go does not have gocode in the unpacking package, so we need to install one, by command:

Go get-u github.com/nsf/gocode

You can see it in the Go directory:


3. Eclipse Integrated Goclipse Plugin

Goclipse (Https://github.com/GoClipse/goclipse) is a Go language plugin for Eclipse, which can be installed online or downloaded, unzipped, in Eclipse, Copy the files in the features and plugins directories into the Eclipse relative file.

After configuring Goroot,gopath ....

Configure Gocode...

4. Eclipse New Go Project

Math.go:package testimport () func Add (a int, b int) int {return a + B}
Main.go:package mainimport ("FMT" "Test") Func main () {FMT. PRINTLN (test. ADD (1, 2))}

Run as->go application to get the results ...

5. Eclipse installation Gocode effect

You can see the function of automatic prompt ....


Related Article

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.