How to install Go Sublime 2

Source: Internet
Author: User
Tags install go sublime text
This is a creation in Article, where the information may have evolved or changed.
  1. Download and install Go
  2. If you downloaded the MSI, install it directly by default, and continue to the next step until you finish
  3. Configuration: I do not need to configure the system variables when installing, the installation time has been modified, if not in the environment variables; C:\Go\bin, add it up (note there is a semicolon)
  4. After installation, download sublime 2:HTTP://WWW.SUBLIMETEXT.COM/2
  5. Open Sublime, press CTRL + ', will pop up a command line, the following this paragraph copy into, import urllib2,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; 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()) ); by = urllib2.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation') press ENTER;
  6. Then restart Sublime.
  7. Download: Packagecontrol.sublime-package: https://sublime.wbond.net/Package%20Control.sublime-package
  8. Put the downloaded file in sublime Text 2\packages\package Control
  9. Tools->build system->new Build system, insert the following content
  10. {    "cmd": ["Go", "Run", "$file _name"],    "File_regex": "^[]*file \" (... *) \ ", line ([0-9]*)",    "Working_dir": "$file _path",    "selector": "Source.go"}
  11. Save.
  12. Restart Sublime, create a new test.go, write the following code
  13. Package Mainimport "FMT" Func Main () {    fmt. Printf ("Hello, world\n")}

  14. CTRL + B, compile.
  15. Ok
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.