chore: fix some typo

pull/3/head
sundowndev 2020-04-13 20:45:16 +01:00
parent 493e6d1ea7
commit d7bbdea8ed
2 changed files with 8 additions and 6 deletions

View File

@ -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
}

View File

@ -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