Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
remove wrapDot from InferFileFormat [nt]
Browse files Browse the repository at this point in the history
  • Loading branch information
flarco committed Nov 10, 2023
1 parent 1a4b5cd commit ecc7aac
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions filesys/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1211,15 +1211,11 @@ func ProcessStreamViaTempFile(ds *iop.Datastream) (nDs *iop.Datastream, err erro
}

func InferFileFormat(path string) FileType {
wrapDot := func(ext string) string {
return g.F(".%s.", ext)
}

path = strings.TrimSpace(strings.ToLower(path))

for _, fileType := range []FileType{FileTypeJsonLines, FileTypeJson, FileTypeXml, FileTypeParquet} {
ext := fileType.Ext()
if strings.HasSuffix(path, ext) || strings.Contains(path, wrapDot(ext)) {
if strings.HasSuffix(path, ext) || strings.Contains(path, ext+".") {
return fileType
}
}
Expand Down

0 comments on commit ecc7aac

Please sign in to comment.