2017-07-13 65 views
1

我是新手去朗,我创建了一个与intellij hello项目。如何导入和使用外部库到一个去项目

现在我想使用外部库。 例如:

连接到塞使用:

http://www.aerospike.com/docs/client/go/examples.html

什么,我不明白的是如何将它导入到解决方案。 我从终端运行命令:

go get github.com/aerospike/aerospike-client-go 

,但我没有看到项目中的任何结果,不明白其对象从我的主要方法使用。

你能帮忙吗?

+2

从[示例](https://github.com/aerospike/aerospike-client-go#usage)开始。 –

+0

我刚刚得到包github.com/aerospike/aerospike-client-go/...:无法下载,$ GOPATH不能设置为$ GOROOT。欲了解更多详情,请参阅:'go help gopath' – user8215502

+1

阅读[如何写代码](https://golang.org/doc/code.html)。 –

回答

1

go get命令将依赖关系下载到您的$ GOPATH目录,从编译器在编译源代码时可访问该目录。现在,您只需按全名导入软件包import github.com/aerospike/aerospike-client-go

相关问题