XP Sublime Text3 project configuration under Golang

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

This explains the Golang environment configuration under XP.

  • You have configured the sublime text of the Golang development environment, that is, you can run HelloWorld, there are code automatically prompt. If not, refer to
  1. Here it is assumed that the project name for the PROJCETDEMO,C disk establishes the following folder structure C:\godemo\src\projectdemo. Create a Main.go file below. For example:

  2. Open with sublime. Then choose Save to Project, I use Projectdemo as project name here. For example:

  3. To add a folder to the project, here is the Projectdemo folder, as the result (if you installed side bar):



  4. Open the sublime auto-generated project file and add the project's Gopath so you can execute the GO command directly in sublime, such as:

  5. Assuming that you now refer to the function in the project Hanlder package, we first execute the Go build,go Run command on the Mainhandler.go, and the system automatically generates. A files, so that other places can invoke such as:



  6. Call the Hanlders function in main and note how the package is referenced:
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.