1. Go download Install and configure environment variables
2. Installation tools:
1) Install Gocode
get -u -v github.com/nsf/gocode
2) Install Godef
get -u -v github.com/rogpeppe/godef
3) Install Golint
get -u -v github.com/golang/lint/golint
4) Install Go-find-references
go get -u -v github.com/lukehoban/go-find-references
5) Install Go-outline
go get -u -v github.com/lukehoban/go-outline
6) Install Goreturns
get -u -v sourcegraph.com/sqs/goreturns
7) Install Gorename
get -u -v golang.org/x/tools/cmd/gorename
(3) Visual Studio Code supports go language debugging to execute the following commands:
-
- Go get-v-u github.com/peterh/liner github.com/derekparker/delve/cmd/dlv
- Brew Install go-delve/delve/delve
- go get-v-u github.com/peterh/liner github.com/derekparker/delve/cmd/dlv
Modify the "Dlv-cert" certificate
1. Turn on "Keychain Access"
2. Open menu, Keychain Access, certificate Assistant, create a certificate
3. Name: DIv identity Type: Self-signed certificate certificate type: Code signing and select "Let me override these defaults"
4. Click "Continue", there is a deadline (days): 365, you can modify, 3650
5. Continue until you see the "Specify a location for this certificate" keychain, select "System" and click the "Create" button
6. Restart the Finder, then open keychain Access, select System, and you will see the created "Dlv-cert" certificate
7. Right-click the "Dlv-cert" certificate, and select "Show Introduction-, trust-and code signing" to: Always Trust
8. Open the terminal and go to the $GOPATH/src
dlv source file directory under the previously installed directory: Github.com/derekparker/delve
9. Enter the following command to recompile a DLV executing program with code signature
GO15VENDOREXPERIMENT=1 CERT=dlv-cert make install
Problems that you may encounter
The execution file "./dlv-h" always return >> Killed:9
StackOverflow Solution:
- I need to does this step below
- Brew Install go-delve/delve/delve
- and go to $GOPATH/src/github.com/derekparker
- Git clone https://github.com/derekparker/delve.git
- Cert=dlv-cert make Install
- (Remove old dlv > Brew Install delve > codesign dlv)
- Not just run
- go get github.com/derekparker/delve/cmd/dlv
- and it works now.
Restart Visual Studio Code to make the perfect use of the