Fix shadowing issue in elasticsearch target (#6774)

master
Harshavardhana 6 years ago committed by kannappanr
parent 71c66464c1
commit d58fc68137
  1. 4
      pkg/event/target/elasticsearch.go

@ -70,7 +70,7 @@ func (target *ElasticsearchTarget) ID() event.TargetID {
}
// Send - sends event to Elasticsearch.
func (target *ElasticsearchTarget) Send(eventData event.Event) (err error) {
func (target *ElasticsearchTarget) Send(eventData event.Event) error {
var key string
remove := func() error {
@ -84,7 +84,7 @@ func (target *ElasticsearchTarget) Send(eventData event.Event) (err error) {
}
add := func() error {
_, err = target.client.Index().Index(target.args.Index).Type("event").BodyJson(map[string]interface{}{"Records": []event.Event{eventData}}).Do(context.Background())
_, err := target.client.Index().Index(target.args.Index).Type("event").BodyJson(map[string]interface{}{"Records": []event.Event{eventData}}).Do(context.Background())
return err
}

Loading…
Cancel
Save