What am I doing these days

I have been studying the Go language and writing papers recently. Not have no time to update, in fact is their own lazy. It should be back to normal afterwards.

What you’ve been doing today

I am installing the Go language this afternoon, because I plan to use VsCode as the main development force of Go. But my VsCode prompt is too slow. It only comes out every second. It’s too slow. I was downloading the Go language tool, but it was blocked again. You can only search the Internet. Just finished. Just a quick note. (The above operation is based on MacOS)


#First install the Go language and skip this step

#Edit the file to set environment variables
vim ~/.bash_profile

#Write the following code
# go path
 export GOROOT=/usr/local/go
 export GOPATH=/Users/vector/go
 export PATH=$PATH:$GOPATH/bin
 export PATH=$PATH:$GOROOT/bin


#Create a SRC folder in your GOPATH directory

cd $GOPATH

mkdir src

cd src

#Because it is blocked, set proxy
export GOPROXY=https://goproxy.io/

#Enable the Go Module function
export GO111MODULE=on

#Start downloading tools
go get -u -v github.com/mdempsky/gocode
go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs
go get -u -v github.com/ramya-rao-a/go-outline
go get -u -v github.com/acroca/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/go-delve/delve/cmd/dlv
go get -u -v github.com/stamblerre/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/sqs/goreturns
go get -u -v golang.org/x/lint/golint
go get -u -v github.com/cweill/gotests/...
go get -u -v github.com/fatih/gomodifytags
go get -u -v github.com/josharian/impl
go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct
go get -u -v github.com/haya14busa/goplay/cmd/goplay
go get -u -v github.com/godoctor/godoctor

#The code prompts that native is too garbage
go get golang.org/x/tools/gopls@latest

#Additional package management
go get -d -u github.com/golang/dep

#then$GOPATHAll executable files generated in the /bin directory are copied to /usr/local/ go/bin directory

cd /usr/local/go
open bin

#Create the /goland/x directory under SRC
mkdir goland.org goland.org/x

cd goland.org/x

#Git installation is required to download the package
git clone https://github.com/golang/tools.git tools
git clone https://github.com/golang/lint.git

Copy the code

VsCode to write code to add the following configuration command + Shift + P select Open Setting (json) to add the configuration

"go.useLanguageServer": true."[go]": {
        "editor.snippetSuggestions": "none"."editor.formatOnSave": true."editor.insertSpaces": false."editor.codeActionsOnSave": {
            "source.organizeImports": true
        },
        "editor.defaultFormatter": "golang.go-nightly"
    },
    "gopls": {
        "usePlaceholders": true.// add parameter placeholders when completing a function
        "wantCompletionDocumentation": true // for documentation in completion items
    },
    "files.eol": "\n".Copy the code

That’s it. Nothing dry. Thank you so much for being here. We’ll see you next time!