This is a creation in Article, where the information may have evolved or changed. have been looking for a hand in the go language development tools, try a lot of things are not good, listen to Beego author recommended to try the industry conscience Microsoft launched Visual Studio Code to develop do go development is really comfortable, today to summarize the configuration of Visual Studio code-go development tools.
1, need to install the tool go, Visual Studio code,git
Baidu Cloud: Http://pan.baidu.com/s/1i5nW50L Password: EBPC
Cloud Disk:
Https://yunpan.cn/c6mGjQf9mU6gE access Password 30ae
2, Go,git, Visual Studio Code installation
Go,git,
Visual Studio Code installation is simple and will not be self-Baidu Google
3. Go Environment configuration
Goroot: Is the Go installation path Gopath: Is the development path can be set freely
After configuration is complete, cmd verification
4 . Configuration of Visual Studio code--vscode-go
- open
visual Studio Code Interface Press shortcut key ctrl+shift+p
- Span style= "FONT-SIZE:19.005PX; Line-height:30.408px "> > input install extensions then jump to the window and enter go click install installation
- Vscode-go need to install plug-ins to use all functions properly, these plugins require git installation, which is why we need to download git
After the installation is complete, look under your own gopath environment. If you have these files, it means you're successful.
5.Visual Studio code usage and configuration
after the software installation is complete, you need to configure,Configure Go Settings.json
{ "Files.autosave": "Onfocuschange", "Go.buildonsave": True, "Go.lintonsave": True, "Go.vetonsave ": True, " Go.buildflags ": [], " go.lintflags ": [], " go.vetflags ": [], " Go.formatonsave ": true, "Go.formattool": "Goreturns", "Go.goroot": "C:\\go", "Go.gopath": "E:\\GO\\GOXM"}
If you need to use the Debug function then you also need to configure Launch.json First Configuration Press F5 select Go now the Go debug is not very good, can only select the Debug folder under, and can not set folder, need to debug that folder under the file configuration that is in
{" version": "0.2.0", "Configurations": [ { "name": "Launch", "type": "Go", "request": " Launch ", " mode ":" Debug ", " RemotePath ":" ", " port ": 2345, " host ":" 127.0.0.1 ", " program ":" ${ Workspaceroot} ", //debug path configuration ${workspaceroot}--gopath Path instance: ${workspaceroot}/src " env ": {}, " args ": [] } ]}
6, the configuration is ready to use it
Detailed use of tutorials recommended: http://my.oschina.net/iyf/blog/5991121, code hints
2, code highlighting, etc.