我试图让这个工作起来越来越沮丧。我已经使用了文档中的示例,但是它们会抛出错误。
特别是这个字段:
To: [&UserFeed]
引发此错误:
does not compile: expected type, found ','
以下是代码段:
getstream_client, err := getstream.New(&getstream.Config{
APIKey: os.Getenv("STREAM_API_KEY"),
APISecret: os.Getenv("STREAM_API_SECRET"),
AppID: os.Getenv("STREAM_APP_ID"),
Location: "us-west",
})
if err != nil {
log.Println("ERR :", err)
}
UserFeed, err := getstream_client.FlatFeed("user", u.StreamId)
if err != nil {
return err
}
GlobalFeed, err := getstream_client.FlatFeed("user", "global")
if err != nil {
return err
}
activity := &getstream.Activity{
Actor: UserFeed.FeedID(),
ForeignID: uuid.New(),
To: [&UserFeed],
Verb: "attempt",
};
activity, err = GlobalFeed.AddActivity(activity);
if err != nil {
return err
}
答案 0 :(得分:2)
TO字段应如下所示。希望这有助于某人:
"SELECT * FROM TABLE WHERE ..."