Skip to content

Commit

Permalink
rename func close to closeCloser
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Feb 12, 2024
1 parent a9be026 commit af985bf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dict.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (d *Dict) Close() {
return
}
log.Println("Closing", d.filename)
close(d.file)
closeCloser(d.file)
d.file = nil
}

Expand Down
2 changes: 1 addition & 1 deletion dictionary.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (d *dictionaryImp) CalcHash() ([]byte, error) {
if err != nil {
return nil, err
}
defer close(file)
defer closeCloser(file)
hash := murmur3.New128()
if _, err := io.Copy(hash, file); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion ifo.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func ReadInfo(filename string) (info *Info, err error) {
return
}

defer close(reader)
defer closeCloser(reader)

r := bufio.NewReader(reader)

Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
)

func close(c io.Closer) {
func closeCloser(c io.Closer) {
err := c.Close()
if err != nil {
log.Println(err)
Expand Down

0 comments on commit af985bf

Please # to comment.