Golang System Package Auto-Fill Plugin

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

    1. Make sure are in $GOPATH/bin your $PATH (Windows: %GOPATH%\bin goes in your %PATH% ). "Keep your Golang in good condition"
    2. Run go get -u golang.org/x/tools/cmd/goimports (you may have to install mercurial). "Go Download Tool"
    3. Install Sublime Text and Gosublime (or make sure you ve got the latest update if it ' s already installed). "Sublime text and Gosublime plugins installed"
    4. Open the Gosublime user config/preference file (Mac: ⌘. ⌘5 Windows: Ctrl+. Ctrl+5 ). Make sure your keep the command button down for the whole shortcut sequence. "Configure"
    5. Make it look like this:
{    "fmt_cmd": ["goimports"]}

然后,你在保存的时候,如果漏掉了系统import的包,就会自动帮你import。

个人感觉,copy的代码更需要这个。自己新写的代码,一般都会记得包含,因为不import对应的包, Gosublime就没办法进行函数的提示了。
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.