1. 程式人生 > >VScode 1.13 gocode提示dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected..

VScode 1.13 gocode提示dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected..

在將VScode升級至 1.13後讓升級gocode,在升級時報出如下錯誤

D:\go_work\src>go get -u -v github.com/mdempsky/gocode
github.com/mdempsky/gocode (download)
Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/gcexportdata?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
package golang.org/x/tools/go/gcexportdata: unrecognized import path "golang.org/x/tools/go/gcexportdata" (https fetch: Get https://golang.org/x/tools/go/gcexportdata?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

失敗原因,發現是從github/golang中下載的tools不包含gocode

解決方法:

根據提示圖片資訊進行查詢,(github/golang下載詳見:http://lc161616.cnblogs.com/p/10132518.html)。提示圖片如下:

    根據vscode提示去github.com/mdempsky/gocode clone下來程式碼。然後放置到提示圖片的路徑下:為了保險我又放置在%GOPATH%\src\golang.org\x\tools下一份。

    最後手動執行go get,安裝成功

D:\go_work\src>go  get -u -v github.com/mdempsky/gocode
github.com/mdempsky/gocode (download)
Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/gcexportdata?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
golang.org/x/tools (download)
Fetching https://golang.org/x/tools/go/internal/gcimporter?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/internal/gcimporter?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
github.com/mdempsky/gocode/internal/lookdot
github.com/mdempsky/gocode/internal/cache
github.com/mdempsky/gocode/internal/suggest
github.com/mdempsky/gocode/internal/gbimporter
github.com/mdempsky/gocode