Documentation
¶
Overview ¶
Package iocloser please refer to README.md
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Close ¶
Close will close the supplied ReadCloser and optionally log
Example ¶
package main
import (
"fmt"
"github.com/corsc/go-commons/iocloser"
)
func main() {
myCloser := &myCloser{}
iocloser.Close(myCloser)
fmt.Printf("wasCalled: %v", myCloser.wasCalled)
}
type myCloser struct {
wasCalled bool
err error
}
// Close implements io.Closer
func (m *myCloser) Close() error {
m.wasCalled = true
return m.err
}
Output: wasCalled: true
Types ¶
Click to show internal directories.
Click to hide internal directories.