2019-08-17 15:55:25 +03:00
|
|
|
// For more tutorials: https://blog.learngoprogramming.com
|
|
|
|
//
|
|
|
|
// Copyright © 2018 Inanc Gumus
|
|
|
|
// Learn Go Programming Course
|
|
|
|
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
|
|
|
//
|
|
|
|
|
2019-08-28 18:54:57 +03:00
|
|
|
package parse
|
2019-08-17 15:55:25 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
2019-08-28 18:54:57 +03:00
|
|
|
// readClose the reader if it's a io.Closer.
|
2019-08-17 15:55:25 +03:00
|
|
|
func readClose(r io.Reader) {
|
|
|
|
if rc, ok := r.(io.Closer); ok {
|
|
|
|
rc.Close()
|
|
|
|
}
|
|
|
|
}
|