From 73e26d48d966adba1b8e409ea64a94c52a748682 Mon Sep 17 00:00:00 2001 From: Arijit Das Date: Thu, 11 Jun 2020 19:24:38 +0530 Subject: [PATCH] Fix CI comments. --- emitter.go | 2 +- input_file.go | 2 +- input_http.go | 2 +- input_raw.go | 2 +- input_tcp.go | 2 +- test_input.go | 5 +++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/emitter.go b/emitter.go index 5e186cd..5ba6854 100644 --- a/emitter.go +++ b/emitter.go @@ -109,7 +109,7 @@ func CopyMulty(src io.Reader, writers ...io.Writer) error { var nr int nr, err := src.Read(buf) - if err == io.EOF || err == StoppedError { + if err == io.EOF || err == ErrorStopped { return nil } if err != nil { diff --git a/input_file.go b/input_file.go index 2dd8f69..5ea97c1 100644 --- a/input_file.go +++ b/input_file.go @@ -156,7 +156,7 @@ func (i *FileInput) Read(data []byte) (int, error) { var buf []byte select { case <-i.exit: - return 0, StoppedError + return 0, ErrorStopped case buf = <-i.data: } copy(data, buf) diff --git a/input_http.go b/input_http.go index b9fc883..d3032a3 100644 --- a/input_http.go +++ b/input_http.go @@ -32,7 +32,7 @@ func (i *HTTPInput) Read(data []byte) (int, error) { var buf []byte select { case <-i.stop: - return 0, StoppedError + return 0, ErrorStopped case buf = <-i.data: } diff --git a/input_raw.go b/input_raw.go index bff3e8d..c2e9de5 100644 --- a/input_raw.go +++ b/input_raw.go @@ -55,7 +55,7 @@ func (i *RAWInput) Read(data []byte) (int, error) { var msg *raw.TCPMessage select { case <-i.quit: - return 0, StoppedError + return 0, ErrorStopped case msg = <-i.data: } diff --git a/input_tcp.go b/input_tcp.go index 7fe35f5..e9a87c6 100644 --- a/input_tcp.go +++ b/input_tcp.go @@ -43,7 +43,7 @@ func (i *TCPInput) Read(data []byte) (int, error) { var buf []byte select { case <-i.stop: - return 0, StoppedError + return 0, ErrorStopped case buf = <-i.data: } copy(data, buf) diff --git a/test_input.go b/test_input.go index 18ff192..0dda8f9 100644 --- a/test_input.go +++ b/test_input.go @@ -7,7 +7,8 @@ import ( "time" ) -var StoppedError = errors.New("reading stopped") +// ErrorStopped is the error returned when the go routines reading the input is stopped. +var ErrorStopped = errors.New("reading stopped") // TestInput used for testing purpose, it allows emitting requests on demand type TestInput struct { @@ -28,7 +29,7 @@ func (i *TestInput) Read(data []byte) (int, error) { var buf []byte select { case <-i.stop: - return 0, StoppedError + return 0, ErrorStopped case buf = <-i.data: }