环境:Windows 10 Professional 64 位。
我想构建/安装一个 go-project(如您所见,twitterbeat)。
C:\apps\Go_workspace\src\github.com\buehler\twitterbeat>go build
# github.com/buehler/twitterbeat/beater
beater\twitterbeat.go:62: b.Events undefined (type *beat.Beat has no field or method Events)
在这里你可以看到文件的第 62 行:
func (bt *Twitterbeat) Setup(b *beat.Beat) error {
logp.Info("Setup waitduration and api keys")
bt.events = b.Events
var err error
bt.period, err = time.ParseDuration(*bt.beatConfig.Period)
if err != nil {
return err
}
anaconda.SetConsumerKey(*bt.beatConfig.Twitter.ConsumerKey)
anaconda.SetConsumerSecret(*bt.beatConfig.Twitter.ConsumerSecret)
bt.api = anaconda.NewTwitterApi(*bt.beatConfig.Twitter.AccessKey, *bt.beatConfig.Twitter.AccessSecret)
return nil
}
我不认为代码有错,因为我是直接从Github下载的.
因为我不在 linux/unix 系统上(而且我的代理有问题),我无法运行“glide”。相反,我自己下载了所有依赖项。
我可以做些什么来构建 twitterbeat?
最佳答案
当您手动下载依赖项时,您需要确保它们与 glide.yaml 文件中的版本相同。 github.com/elastic/libbeat/beat/beat.go
中 beat.Beat
的当前版本比 glide.yaml 中的版本更新并且没有Events
字段。
关于twitter - 去建立事件未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36787081/