VS Code go 插件安装失败 r.declReader.Reset undefined
生活随笔
收集整理的這篇文章主要介紹了
VS Code go 插件安装失败 r.declReader.Reset undefined
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在安裝完 VS Code 后開始安裝 go 的插件發現有如下錯誤
wohu@wohu:~/GoCode/src$ go install github.com/nsf/gocode
# github.com/nsf/gocode
github.com/nsf/gocode/package_ibin.go:99: r.declReader.Reset undefined (type bytes.Reader has no field or method Reset)
github.com/nsf/gocode/package_ibin.go:148: undefined: io.SeekCurrent
github.com/nsf/gocode/package_ibin.go:152: undefined: io.SeekCurrent
github.com/nsf/gocode/package_ibin.go:214: r.declReader.Reset undefined (type bytes.Reader has no field or method Reset)
查閱相關資料后發現是由于使用
sudo apt-get insall golang-go
命令安裝的 go 版本為 go 1.6 , 版本過低導致。 所以需要卸載這個版本再重新安裝更新的版本。
wohu@wohu:~/GoCode/src$ sudo apt-get remove golang-go
[sudo] password for wohu:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:golang-1.6-go golang-1.6-race-detector-runtime golang-1.6-srcgolang-race-detector-runtime golang-src
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:golang-go
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 48.1 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 286275 files and directories currently installed.)
Removing golang-go (2:1.6-1ubuntu4) ...
Processing triggers for man-db (2.7.5-1) ...wohu@wohu:~/GoCode/src$ sudo apt-get remove golang-1.6-*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'golang-1.6-go' for glob 'golang-1.6-*'
Note, selecting 'golang-1.6-doc' for glob 'golang-1.6-*'
Note, selecting 'golang-1.6-race-detector-runtime' for glob 'golang-1.6-*'
Note, selecting 'golang-1.6-src' for glob 'golang-1.6-*'
Package 'golang-1.6-doc' is not installed, so not removed
The following packages will be REMOVED:golang-1.6-go golang-1.6-race-detector-runtime golang-1.6-srcgolang-race-detector-runtime golang-src
0 upgraded, 0 newly installed, 5 to remove and 6 not upgraded.
After this operation, 198 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 286249 files and directories currently installed.)
Removing golang-1.6-go (1.6.1-0ubuntu1) ...
Removing golang-race-detector-runtime (2:1.6-1ubuntu4) ...
Removing golang-1.6-race-detector-runtime (0.0+svn252922-0ubuntu1) ...
dpkg: warning: while removing golang-1.6-race-detector-runtime, directory '/usr/lib/go-1.6/src/runtime/race' not empty so not removed
Removing golang-src (2:1.6-1ubuntu4) ...
Removing golang-1.6-src (1.6.1-0ubuntu1) ...
Go 1.12 安裝步驟參考以下鏈接:
https://blog.csdn.net/wohu1104/article/details/97965998
總結
以上是生活随笔為你收集整理的VS Code go 插件安装失败 r.declReader.Reset undefined的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 亏赚?急
- 下一篇: Go 学习笔记(2)— 安装目录、工作区