Eclipse-based visual development environment for GO language

Source: Internet
Author: User
Tags gdb debugger

Http://jingyan.baidu.com/article/d7130635032e2f13fdf475b8.html

Eclipse-based visual development environment for GO language
    • |
    • Browse:2924
    • |
    • Updated: 2013-12-21 18:24
    • |
    • Tags:eclipse
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
Step through Reading

Build and use an eclipse-based go language visualization development environment.

Attention:

Before you read this piece of experience, make sure that the necessary tools are installed or open

Tools/Materials
    • Set up the Go Language development environment, detailed steps see experience:

      Http://jingyan.baidu.com/article/c85b7a6414e5ee003bac95c6.html

    • Eclipse Development Platform

      Official:

      Http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/junosr2

      Of course, if you are using a computer with a slow speed, you can also choose the goclipse I have downloaded ( ie: no need to look at the steps )

      Baidu Network Address:

      http://pan.baidu.com/share/link?shareid=503166&uk=2636671033

Construction method
  1. 1

    Download Eclipse or my packaged goclipse, unzip the package, you can see a eclipse.exe file, open it, and go into Eclipse, the IDE.

    Note that if a dialog box "Workspace Launcher" (3) pops up during the entry process, the workspace is set, which is where the project code is stored.

  2. 2

    However, this eclipse does not yet support the development of the go language, so we will install the Goclipse plugin for this eclipse:

    Click "Help" in the menu, "Install New Software"

  3. 3

    Then, click on the "add" button to pop up an "Add Repository" dialog box,

    In "Name" In the box, enter

    "goclipse" (not including quotation marks),

    In "Location" inthe box, enter

    "https://goclipse.googlecode.com/svn/trunk/goclipse-update-site/" (not including quotation marks)

    Then click on the "OK" button

  4. 4

    Then, the list below shows Pending... and then becomes goclipse,

    Select it.

    Then all the way "Next >", and finally wait for the installation.

    Restart (Restart) Eclipse. The Goclipse is installed successfully.

  5. 5

    After you restart Eclipse, you will see a Go tab in the upper-right corner of the window, and a menu item for go Project and go file appears in the menu bar, " File", "New" . If not, you can open the Go tab by tapping the open perspective icon in the upper-right corner.

  6. 6

    The next step is to configure the Go language path.

    Click " window", "Preferences" in the menu item, and select "Go"in the list item on the left. You can then configure the Go language path and environment on the right (configuration, where GOOS: represents your system, because it was developed under Windows, so choose windows. Goarch: indicates the CPU type of your computer. The author is i386, so choose 386).

    If you have a GDB debugger, you can also set GDB's path by selecting "Debugger" under "Go" in the list item.

  7. 7

    Let's try new and compile a project to run a go language.

    Click on the menu bar "File" , " New" , " Go Project"

    In project name: Enter the name of the project in the input box, for example "HelloWorld"

    Click "Finish" button to complete a new project

    You can see that a HelloWorld project appears in the project Explorer Bar

  8. 8

    Next, add the go source code.

    Expand HelloWorld Project

    Right-click the src folder and select " New","Go File"

    Fill in the source code file name in the input box in source file: (note: Must end with. Go)

    Under the option box for the source file Type , select the Empty Main Function in Command source file

    (means to generate a go source code that has an empty main function (start function))

  9. 9

    Then edit the source code that you just created:

    Package Main

    Import (

    "FMT"

    )

    Func Main () {

    Fmt. Println ("helloworld!");

    }

    Save source Code (CTRL+S)

  10. 10

    The next step is to run

    Before running, make sure that the Console (console) window is open (open method Click on the menu bar, "window", "Show View", "console")

    Then click on the "Run" button in the toolbar to run the program

    You can then see the helloworld! text displayed in the console console.

  11. 11

    Here, the Go Language visualization development environment under eclipse has been built, and of course eclipse is not the only Ide,go language developed by the Go language assistant IDE and Gedit,vim,notepad++,liteide and so on.

Eclipse-based visual development environment for GO language

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.