diff options
| author | Felix Hanley <felix@userspace.com.au> | 2017-03-19 15:19:42 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2017-03-19 15:19:42 +0000 |
| commit | 8a541d499b6f117cd3a81e475ee779ba60fc0637 (patch) | |
| tree | 7b3b5326235725ab93056b5ff4637d987fb0a7b6 /vendor/github.com/gocarina/gocsv/encode.go | |
| parent | fe847b2d01060044274d20d2c35ae01a684d4ee3 (diff) | |
| download | crjw-maps-8a541d499b6f117cd3a81e475ee779ba60fc0637.tar.gz crjw-maps-8a541d499b6f117cd3a81e475ee779ba60fc0637.tar.bz2 | |
Diffstat (limited to 'vendor/github.com/gocarina/gocsv/encode.go')
| -rw-r--r-- | vendor/github.com/gocarina/gocsv/encode.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/github.com/gocarina/gocsv/encode.go b/vendor/github.com/gocarina/gocsv/encode.go index 4a87462..6e4e67b 100644 --- a/vendor/github.com/gocarina/gocsv/encode.go +++ b/vendor/github.com/gocarina/gocsv/encode.go @@ -17,7 +17,10 @@ func newEncoder(out io.Writer) *encoder { func writeFromChan(writer *csv.Writer, c <-chan interface{}) error { // Get the first value. It wil determine the header structure. - firstValue := <-c + firstValue, ok := <-c + if !ok { + return fmt.Errorf("channel is closed") + } inValue, inType := getConcreteReflectValueAndType(firstValue) // Get the concrete type if err := ensureStructOrPtr(inType); err != nil { return err |
