英文:
installing go packages in linux
问题
我是GO的新手,刚刚安装了适用于Linux AMD64的最新版本,但是尽管我可以运行go命令,但似乎无法获取、构建或安装任何命令。
go get bufio
package bufio: 无法识别的导入路径 "bufio"
有什么想法吗?
英文:
I am new at GO and just installed the latest version available for Linux AMD64, but although I can run go commands, I don't seem to be able to get, build or install any commands.
go get bufio
package bufio: unrecognized import path "bufio"
Any ideas?
答案1
得分: 10
包“bufio”是标准库的一部分。你不能“go get”它。但是不用担心,任何标准和支持的安装过程都会安装这个包(就像整个stdlib一样),所以不需要“go get”它。
只需在想要使用其导出声明的包中包含
import "bufio";
它应该“只是工作”;-)
英文:
Package "bufio" is part of the standard library. You cannot "go get" it. But no worry, any standard and supported installation procedure makes this package installed (as is the whole stdlib), so there's no need to "go get" it.
Just include
import "bufio"
in a package where you want to use its exported decalarations and it should "just work"
答案2
得分: 3
你是否按照安装说明中所描述的设置了GOROOT和GOBIN两个环境变量?
顺便问一下,你是从源码安装的还是使用发布的tarball安装的?
英文:
Did you set both the GOROOT and GOBIN environmental variables as described in the installation instructions?
BTW, did you install it from source or the release tarball?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论