具體細(xì)節(jié)這里有詳解,前面都可以按照介紹一步步的來(lái)
主要卡在3、安裝go.tools Binaries這一步上,找了很多資料才找全。
首先可以在本地建一個(gè)目錄來(lái)存放這些源碼,并將這個(gè)目錄設(shè)為GOPATH,就是將下面這句加入~/.bash_profile中
<pre>export GOPATH=$HOME/dev/goapp</pre>
然后在goapp中建立三個(gè)目錄bin, pkg, src,將下面這些源碼clone在src下
gocode
<pre>git clone https://github.com/nsf/gocode.git</pre>
goimports gorename 這兩個(gè)都在tools下面可以找得到
<pre>git clone https://github.com/golang/tools.git</pre>
godef
<pre>git clone https://github.com/rogpeppe/godef.git</pre>
golint
<pre>git clone https://github.com/golang/lint.git</pre>
errcheck 安裝需要這兩個(gè)
<pre>git clone https://github.com/kisielk/errcheck.git
git clone https://github.com/kisielk/gotool.git</pre>
全部下完之后,可以使用go install安裝
比如第一個(gè)可以 go install gocode, 有的可能報(bào)目錄的錯(cuò)誤,需要適當(dāng)?shù)恼{(diào)整源碼所在的目錄。
默認(rèn)二進(jìn)制文件裝在goapp/bin下面,需要全部挪到$GOROOT/bin下面, 我的是在/usr/local/go/bin
后面就可以接著看上面的文章了。
還有兩個(gè)問(wèn)題沒(méi)有搞明白:mac下item高亮并沒(méi)有生效,oracle源碼暫時(shí)沒(méi)加,不知道是什么作用。