fix: close file in the GrepFile func
This commit is contained in:
parent
d703f533d0
commit
5a366cd62b
@ -69,6 +69,7 @@ func GrepFile(patten string, filename string) (lines []string, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer fd.Close()
|
||||||
lines = make([]string, 0)
|
lines = make([]string, 0)
|
||||||
reader := bufio.NewReader(fd)
|
reader := bufio.NewReader(fd)
|
||||||
prefix := ""
|
prefix := ""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user