aboutsummaryrefslogtreecommitdiffstats
path: root/reader/reader.go
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2019-12-01 21:23:57 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2019-12-01 21:26:05 +0000
commit182e71afccb8ef649e9738aa8034c9c2cdfcfd7a (patch)
tree2a08123becd569f2694638725fc713b6d4249a29 /reader/reader.go
parent332aee4fa6c75e07337efaa44e2b4c8ec4348c65 (diff)
tweaking the globbing func
Diffstat (limited to 'reader/reader.go')
-rw-r--r--reader/reader.go3
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 {