forked from pothtonswer/discordmuffin
Close the file after read
Close the file when it has been full readed
This commit is contained in:
parent
ae30611faf
commit
95fdc0a971
1 changed files with 4 additions and 0 deletions
|
@ -131,6 +131,10 @@ func loadSound() error {
|
|||
|
||||
// If this is the end of the file, just return.
|
||||
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
||||
file.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue