Solution JetBrains Development tool cannot run or debug (run/debug) Go/golang program [Intellj idea,webstorm,pycharm,phpstrom,android Studio]

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

Go Plugin

First make sure the Go plugin is installed: Files-settings-plugins-browse repositories, search go, then install

Set up the project SDK

You need to set a Go SDK for your open project to tell if this is a go project, if not set please set: File-project Structure, choose Go SDK, if not added on the new one

After Setup, follow the prompts reload

Run Package

If you run a single file, such as: Main.go, the code used in other files defined functions, structs, etc., then the direct operation will be reported undefined error. At this point we need to run the entire package instead of a single file, run-edit the "+"-go application in the upper-left corner of the configurations-point, you might see something like this:

Give it a name, my project name is test, it runs a call "Run Test", run kind Select the package, then the package text box appears below, the project name, I am "test", because we set up the project SDK, So module it will automatically select our project name, if not set the project SDK, there will be no choice, always error.

Click OK, then click Run on the menu bar above to see if there is a "run ' Run Test '", "Debug ' Run Test '" option, if yes, congratulations:) happy Run and Debug ~ ~ ~

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.