Merge pull request #244 from robbix1206/Example_Close_File

Close the file after read
This commit is contained in:
Bruce 2016-09-03 11:31:29 -05:00 committed by GitHub
commit 1acc7dc017

View file

@ -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
}