我是 lang 新手,我用 intellij 创建了一个 hello 项目。
现在我想使用外部库。例如:
使用以下命令连接到 aerospike:
http://www.aerospike.com/docs/client/go/examples.html
我不明白的是如何将它导入到解决方案中。我从终端运行命令:
go get github.com/aerospike/aerospike-client-go
Run Code Online (Sandbox Code Playgroud)
但我在项目中没有看到任何结果,也不知道从我的主要方法中使用哪个对象。
你能帮我吗?
我正试图运行一个空中飞行的例子:
package main
import (
"github.com/aerospike/aerospike-client-go"
"fmt"
)
func panicOnError(err error) {
if err != nil {
panic(err)
}
}
func main() {
// define a client to connect to
client, err := NewClient("127.0.0.1", 3000)
panicOnError(err)
key, err := NewKey("test", "aerospike", "key")
panicOnError(err)
// define some bins with data
bins := BinMap{
"bin1": 42,
"bin2": "An elephant is a mouse with an operating system",
"bin3": []interface{}{"Go", 2009},
}
// write the bins
err = client.Put(nil, key, bins)
panicOnError(err)
// read …Run Code Online (Sandbox Code Playgroud) 我有期货清单
List<Future<Boolean>> futures = service.invokeAll( Arrays.asList( callable1, callable2 ));
Run Code Online (Sandbox Code Playgroud)
我需要的是一种获取结果列表的方法
可以提供Java解决方案吗?
就像是 whenAll()...