日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

VS Code go 插件安装失败 r.declReader.Reset undefined

發布時間:2023/11/27 生活经验 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。