Skip to content

Commit

Permalink
to/from slash in FS impl
Browse files Browse the repository at this point in the history
  • Loading branch information
fwereade committed Apr 22, 2024
1 parent 9779bf9 commit 117cfb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gotfparse/pkg/converter/relativeResolveFs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ func newRelativeResolveFs(rootDir string) fs.FS {
// Open allows relative paths leading outside the FS root.
func (i relativeResolveFs) Open(name string) (fs.File, error) {
fullPath := filepath.Join(i.rootDir, name)
return os.Open(fullPath)
return os.Open(filepath.FromSlash(fullPath))
}

// Path subverts the FS concept by allowing clients to get the real path.
func (i relativeResolveFs) Path() string {
return i.rootDir
return filepath.ToSlash(i.rootDir)
}

var _ fs.FS = new(relativeResolveFs)

0 comments on commit 117cfb8

Please sign in to comment.