fix: close file in the GrepFile func
This commit is contained in:
@@ -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 := ""
|
||||||
|
|||||||
Reference in New Issue
Block a user