diff options
Diffstat (limited to 'reader/reader.go')
-rw-r--r-- | reader/reader.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/reader/reader.go b/reader/reader.go index 4b9c425..5ba40ae 100644 --- a/reader/reader.go +++ b/reader/reader.go @@ -178,6 +178,9 @@ func Extract(dm string, ssheet string) ExtractedData { //GetTargetFiles finds all xlsx and xlsm files in directory. func GetTargetFiles(path string) ([]string, error) { + if lastchar := path[len(path)-1:]; lastchar != string(filepath.Separator) { + return nil, fmt.Errorf("path must end in a %s character", string(filepath.Separator)) + } fullpath := strings.Join([]string{path, "*.xlsx"}, "") output, err := filepath.Glob(fullpath) if err != nil { |