dongqiulei6805 2016-04-22 07:01
浏览 56
已采纳

去建立事件未定义

Environment: Windows 10 Professional 64-Bit.

I want to build / install a go-project (twitterbeat as you can see).

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)

Here you can see line 62 of the file:

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
}

I don't think that the code is wrong, because I donwloaded it directly from Github.

Because I am not on a linux / unix system (and I had problems with the proxy), i couldn't run "glide". Instead I donwloaded all dependencies by myself.

What can I do to build twitterbeat?

  • 写回答

2条回答 默认 最新

  • douxie1957 2016-04-22 07:50
    关注

    When you download the dependencies by hand, you need to make sure that they are the same version as in the glide.yaml file. The current version of beat.Beat in github.com/elastic/libbeat/beat/beat.go is newer than the one in the glide.yaml and doesn't have an Events field any more.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!