Fix shadowing issue in elasticsearch target (#6774)

This commit is contained in:
Harshavardhana 2018-11-07 12:09:03 -08:00 committed by kannappanr
parent 71c66464c1
commit d58fc68137

View File

@ -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
}