1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Cast Input and Output to closer

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-05-08 12:57:19 -07:00
parent 8d3c5b7dca
commit 170e4d2e19

View file

@ -118,7 +118,7 @@ func (o *Output) Close() error {
defer o.Unlock()
var firstErr error
for _, dst := range o.dests {
if closer, ok := dst.(io.WriteCloser); ok {
if closer, ok := dst.(io.Closer); ok {
err := closer.Close()
if err != nil && firstErr == nil {
firstErr = err
@ -154,7 +154,7 @@ func (i *Input) Read(p []byte) (n int, err error) {
// Not thread safe on purpose
func (i *Input) Close() error {
if i.src != nil {
if closer, ok := i.src.(io.WriteCloser); ok {
if closer, ok := i.src.(io.Closer); ok {
return closer.Close()
}
}