I pass the separator that we want to clean with into filepath.Clean.

I'll check again, I think it's doing the right thing, but I could very well
be wrong as I don't have a win32 machine to test on.


On Fri, Nov 15, 2013 at 9:57 AM, Keith Rarick <notifications@github.com>wrote:

> In filesystem.go:
>
> > @@ -33,4 +30,17 @@ func (f *fs) ReadDir(dirname string) ([]os.FileInfo, error) { return ioutil.Read
> >
> >  func (f *fs) Lstat(name string) (os.FileInfo, error) { return os.Lstat(name) }
> >
> > -func (f *fs) Join(elem ...string) string { return filepath.Join(elem...) }
> > +func (f *fs) PathSeparator() byte { return os.PathSeparator }
> > +
> > +// Join joins any number of path elements into a single path, adding
> > +// a Separator if necessary. The result is Cleaned, in particular
> > +// all empty strings are ignored.
> > +func Join(fs FileSystem, elem ...string) string {
> > +	sep := string(fs.PathSeparator())
> > +	for i, e := range elem {
> > +		if e != "" {
> > +			return filepath.Clean(strings.Join(elem[i:], sep))
>
>  Didn't I do that with Clean(, sep) ?
>
> Not sure what you mean. This line calls filepath.Clean,
> but it needs to call a local copy of Clean, which isn't
> in this package or this pull request.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/kr/fs/pull/5/files#r7676624>
> .
>