Skip to content

Commit

Permalink
regex compile
Browse files Browse the repository at this point in the history
  • Loading branch information
kmulvey committed Oct 6, 2022
1 parent d506d68 commit 89bf7f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/nsquared/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ func main() {
}

// list all the files
var files, err = path.ListFilesWithFilter(dir, regexp.MustCompile(".*.jpg$|.*.jpeg$|.*.png$.*.webm$"))
var re, err = regexp.Compile(".*.jpg$|.*.jpeg$|.*.png$.*.webm$")
handleErr("regex compile", err)
files, err := path.ListFilesWithFilter(dir, re)
handleErr("listFiles", err)
var fileNames = path.OnlyNames(files)
log.Infof("Found %d files", len(files))
Expand Down

0 comments on commit 89bf7f2

Please sign in to comment.