chore: fix some typo
parent
493e6d1ea7
commit
d7bbdea8ed
|
@ -2,6 +2,7 @@ package engine
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
@ -9,14 +10,11 @@ import (
|
|||
// GetFilesFromDir walks through a directory and returns
|
||||
// file paths contained inside.
|
||||
func GetFilesFromDir(dir string) (files []string) {
|
||||
// is dir?
|
||||
// is readable/exists?
|
||||
filepath.Walk(dir, func(fp string, fi os.FileInfo, err error) error {
|
||||
err := filepath.Walk(dir, func(fp string, fi os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return nil
|
||||
}
|
||||
fi.Mode()
|
||||
if fi.IsDir() {
|
||||
return nil
|
||||
}
|
||||
|
@ -26,5 +24,9 @@ func GetFilesFromDir(dir string) (files []string) {
|
|||
return nil
|
||||
})
|
||||
|
||||
return
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
return files
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
const tabPadding = 3
|
||||
const tabPaddingChar = ' '
|
||||
|
||||
// QueryResult ...
|
||||
// QueryResult defines the structure of a query result
|
||||
type QueryResult struct {
|
||||
File string
|
||||
Count float64
|
||||
|
|
Loading…
Reference in New Issue