Add nil-receiver awareness to all Reader/Writer
This commit is contained in:
parent
dbc41bb805
commit
98dc811536
5 changed files with 20 additions and 3 deletions
|
@ -24,6 +24,10 @@ func NewHashAppendWriter(w io.Writer, h hash.Hash) *HashAppendWriter {
|
|||
}
|
||||
|
||||
func (h *HashAppendWriter) Close() error {
|
||||
if h == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !h.closed {
|
||||
h.closed = true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue