IntelliJ Idea Development Golang Environment configuration

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

See an article saying that IntelliJ idea development as a go development environment is good, suddenly crazy to try a bit.
Who knows follow the tutorial go, to the back more and more wrong, to Baidu other tutorials, who know the same ...

Okay, here we go.

    1. First put the GO installation good ... (Self-installing, attach an article I wrote before Mac install go)
    2. Installation IntelliJ IDEA , download address: https://www.jetbrains.com/idea/download/.
    3. Download go-lang-idea-plugin This plugin, download address: https://plugins.jetbrains.com/plugin/5047. (PS: On-line Baidu's basic is the next source code, compiled, engaged in an afternoon compilation, who knows has been compiled good can download)
    4. After the download, is a zip file, do not need to unzip, open IntelliJ idea, open Preferences->Plugins , click Install plugin from disk... , select the zip file just downloaded, and then reboot, plug-in is installed.

    5. Open File->Project Structure... , can not find a random open a project to see. Click SDKS , create a new GO SDK , fill GO in the installation directory.

To use: Create a new Go project, click Edit Configurations... , create a new one, and the file to the Go Application right File of your files pack main func main , and Output directory output the directory for the compiled file. When you are finished, you can compile and run the program by selecting the new debug option.

Next, let's point to IntelliJ Idea's shortcut key (My Mac OSX):
1. cmd+shift+o Find Jump File
2. Cmd+shift+l Code Alignment
3. Cmd+shift+alt+f Go fmt a file
4. Cmd+shift+alt+p Go FMT Entire project
5. Cmd+alt+o Auto Import
6. Cmd+f12 shows the structure of the current file
7. Press and hold CMD to click on the structure to jump source
8. cmd+p Display function parameters
9. Cmd+e Show recently edited file
Alt+enter Auto Fix Error
Shift+f6 reconstruction

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.