C2FO / vfs

Pluggable, extensible virtual file system for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resolving registered FS

yellow-sky opened this issue · comments

I'm use vfssimple with regestered fs (s3) as shown in example: https://github.com/C2FO/vfs/blob/ab2673ff5f8388b94a8db22464de5c2f7e3e8105/docs/vfssimple.md#usage

But this example don't work without small additional:

backend.Unregister(s3.Scheme)

Backend resolve fs by sheme\sheme+bucket\scheme+bucket+name and return first found - default registered fs.

Maybe there is an option to disable automatic registration? If not, then it may be add to example?

Finally getting a chance to look at this. The logic to resolve the backend to return basically returning the first match it came across, 's3', in the example, instead of the more specific 's3://mybucket/'. Updating the logic to match the most specific backend should resolve this. I'll push up a fix shortly.