What I learned in Mac + sublime + golang environment Configuration

Source: Internet
Author: User
Environment variables:
Gopath is a path list, similar to the path settings:
Gopath =/home/user/go:/home/user/workspace_go :***
After creating a workspace, you can configure gopath (the configuration file is ~ /. Bash_profile ).
Export gopath =/users/user name/go:/users/user name/Documents documents/workspace/workspace_go

Set environment variables on Mac:
1. Open the Application> utility> terminal;
2. Locate your user's home directory in the terminal, and enter: Cd ~ ;
3. Create an empty file and enter touch. bash_profile;
4. edit the file and enter: open. bash_profile;
5. In this file, enter: Export path =$ {path }:< file directory>;
6. To add other environment variables such as java_home, enter: Export java_home =/library/Java
/Home;
7. Run source. bash_profile to restart the terminal and test.


About sublime:
1. install package Control
CTRL + 'Open the command line and execute the following code:
Import urllib2, OS; pF = 'package control. sublime-package '; IPP = sublime. installed_packages_path (); OS. makedirs (IPP) if not OS. path. exists (IPP) else none; urllib2.install _ opener (urllib2.build _ opener (urllib2.proxyhandler (); open (OS. path. join (iPP, PF), 'wb '). write (urllib2.urlopen ('HTTP: // sublime.wbond.net/'{pf.replace ('', '% 20 ')). read (); print 'Please restart sublime text to finish installation' 2. install the gosublime Plugin:
Command + Shift + P open package control, enter PCIP (package control: the abbreviation of install package), and then enter the installation package name

3. Compile the go file
Command + B
Go build ***. Go

4. Run
Run ***. Go

What I learned in Mac + sublime + golang environment Configuration

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.