From e726e45dc0c25cb3a0b3f9f2e727e43a83db8d12 Mon Sep 17 00:00:00 2001 From: Nicholas Wiersma Date: Wed, 25 Jan 2017 12:25:06 +0100 Subject: [PATCH 1/3] Fix kafka issue (#419) --- input_kafka.go | 2 +- output_kafka.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/input_kafka.go b/input_kafka.go index 715d5ee..25e6d72 100644 --- a/input_kafka.go +++ b/input_kafka.go @@ -22,7 +22,7 @@ func NewKafkaInput(address string, config *KafkaConfig) *KafkaInput { var con sarama.Consumer - if config.consumer.(*mocks.Consumer) != nil { + if mock, ok := config.consumer.(*mocks.Consumer); ok && mock != nil { con = config.consumer } else { var err error diff --git a/output_kafka.go b/output_kafka.go index 336800f..ec9855d 100644 --- a/output_kafka.go +++ b/output_kafka.go @@ -26,7 +26,7 @@ func NewKafkaOutput(address string, config *KafkaConfig) io.Writer { var producer sarama.AsyncProducer - if config.producer.(*mocks.AsyncProducer) != nil { + if mock, ok := config.producer.(*mocks.AsyncProducer); ok && mock != nil { producer = config.producer } else { c.Producer.RequiredAcks = sarama.WaitForLocal From bf1c67c5a197c3e77aa0a56d84e504b7fd2e3f19 Mon Sep 17 00:00:00 2001 From: Leonid Bugaev Date: Sun, 5 Feb 2017 17:26:04 +0300 Subject: [PATCH 2/3] Add install task --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index cd1c5e5..a6f3326 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,9 @@ release-x86: release-mac: go build $(MAC_LDFLAGS) && tar -czf gor_$(VERSION)_mac.tar.gz gor && rm gor +install: + go install $(MAC_LDFLAGS) + build: docker build -t gor . From 6a4888212577d656a1bdbb92ef727e8150d1c5ea Mon Sep 17 00:00:00 2001 From: Leonid Bugaev Date: Sun, 5 Feb 2017 17:26:22 +0300 Subject: [PATCH 3/3] Fix infinite lock at file output --- output_file.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/output_file.go b/output_file.go index 915711c..209d563 100644 --- a/output_file.go +++ b/output_file.go @@ -69,10 +69,8 @@ func NewFileOutput(pathTemplate string, config *FileOutputConfig) *FileOutput { if o.closed { break } - o.mu.Lock() o.updateName() o.flush() - o.mu.Unlock() } }()