简体   繁体   English

在Linux中安装Go软件包

[英]installing go packages in linux

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新手,只是安装了可用于Linux AMD64的最新版本,但是尽管我可以运行go命令,但我似乎无法获取,构建或安装任何命令。

go get bufio
package bufio: unrecognized import path "bufio"

Any ideas? 有任何想法吗?

Package "bufio" is part of the standard library. 软件包“ bufio”是标准库的一部分。 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. 但是不用担心,任何标准和受支持的安装过程都可以安装此软件包(就像整个stdlib一样),因此不需要“去获取”它。

Just include 只包括

import "bufio"

in a package where you want to use its exported decalarations and it should "just work" ;-) 在要使用其导出的十进制的程序包中,它应该“正常工作” ;-)

Did you set both the GOROOT and GOBIN environmental variables as described in the installation instructions ? 同时设置GOROOT和GOBIN环境变量中所描述的安装说明

BTW, did you install it from source or the release tarball? 顺便说一句,您是从源代码还是从发行版tarball安装的?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM