mirror of https://bitbucket.org/ausocean/av.git
filter: basic: add error checking for close()
This commit is contained in:
parent
d4c60358a9
commit
17e1eb0436
|
@ -80,7 +80,10 @@ func NewBasic(dst io.WriteCloser, debug bool, t, p int) *Basic {
|
||||||
// Implements io.Closer.
|
// Implements io.Closer.
|
||||||
func (bf *Basic) Close() error {
|
func (bf *Basic) Close() error {
|
||||||
if bf.debug {
|
if bf.debug {
|
||||||
bf.file.Close()
|
err := bf.file.Close()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("file cannot be closed: %w", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue