spf13 / afero

A FileSystem Abstraction System for Go
Apache License 2.0
5.9k stars 510 forks source link

move fs implementations into sub packages #89

Open rgarcia opened 8 years ago

rgarcia commented 8 years ago

Right now if I depend on github.com/spf13/afero, I also have to pull in a lot of potentially unnecessary dependencies that might not be related to the FS implementation I'm using, e.g. github.com/pkg/sftp.

Let me know if you agree and would be open to a PR.

kofalt commented 8 years ago

For reference, here's the current set of remote dependencies, do you know which would be trimmed?

$ go get -v github.com/spf13/afero

github.com/spf13/afero (download)
github.com/pkg/sftp (download)
github.com/kr/fs (download)
github.com/pkg/errors (download)
golang.org/x/crypto (download)
golang.org/x/text (download)

Godoc also has the imports and graph.

rgarcia commented 8 years ago

The graph with std lib hidden is informative: https://godoc.org/github.com/spf13/afero?import-graph&hide=1

It looks like almost all of the third party deps fall from the sftp FS. This suggests the lowest hanging fruit might be to isolate the sftp implementation in the github.com/afero/sftp package.

kofalt commented 8 years ago

Works for me! I definitely support sub-packaging when implementations have unique import requirements. I'm also not the maintainer, though :smile: