Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use GoLand to start and run a Go project

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to use GoLand to start and run the Go project". In the daily operation, I believe many people have doubts about how to use GoLand to start and run the Go project. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to use GoLand to start and run the Go project". Next, please follow the editor to study!

Step 1: before you begin, make sure that the go locale is installed and the gopath environment variable installation directory c:\ GO is configured.

Step 2: create a new project

Step 3, select the project path

Step 4: manually create three bin,pkg,src folders under this directory

Bin is used to store compiled .exe files.

Where pkg places the custom package

Src the point where the development files of our project are stored, and create the project and project files in src

Step 5: configure gopath and goroot of goland (previously configured can be omitted) to open file-settings-GO

Click GOPATH to select the project path

Step 6: create a folder name under the src directory for the project name and then create a main.go in it, with the code in the main.go

Step 7: configure the run settings

Run Kind Select Directory

Directory specifies the project directory

Out Directory specifies the file output path after compilation is completed

WOrking Directory specifies the path to the workspace

Step 8: click the green triangle in the upper right corner to run after the configuration is complete.

It is worth noting that the package of the go file specified by run must be main to run, not with the main method.

If there is any system incompatibility error, it is most likely that package is not caused by main.

At this point, the study on "how to use GoLand to start and run the Go project" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report