Skip to content

Commit

Permalink
Fix single file handling when path does not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
wbrown committed Jul 18, 2023
1 parent 7d3ad02 commit 1fe59a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/dataset_tokenizer/dataset_tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type PathInfo struct {
// returning a slice of PathInfo.
func GlobTexts(dirPath string) (pathInfos []PathInfo, err error) {
// If the path is a file, return it.
if stat, statErr := os.Stat(dirPath); statErr != nil && !stat.IsDir() {
if stat, _ := os.Stat(dirPath); stat != nil && !stat.IsDir() {
return []PathInfo{{
Path: dirPath,
Size: stat.Size(),
Expand Down

0 comments on commit 1fe59a1

Please sign in to comment.