go-buffer
go-buffer copied to clipboard
Calling Close multiple times results in a panic
Prerequisites
- [x] I searched to see if the issue already exists.
Description
https://github.com/tj/go-buffer/blob/3b6460d4b37b149c3a7d9081f0b39a05eee31a89/buffer.go#L164 the close method calls close on the channel, so if this is called multiple times, a panic will occur. When using apexlog's handler, it uses go-buffer under the hood when the handler calls it's Close method https://github.com/apex/log/blob/8da83152b5d6177b4bfe3d12810a5afd25355170/handlers/apexlogs/apexlogs.go#L108 and as a result, a panic will occur. Though you shouldn't need to call Close more than once, it certainly wasn't expected behavior for me when I hit a panic as a result of doing so.