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 {
|
||||
return
|
||||
}
|
||||
defer fd.Close()
|
||||
lines = make([]string, 0)
|
||||
reader := bufio.NewReader(fd)
|
||||
prefix := ""
|
||||
|
||||
Reference in New Issue
Block a user