afero
afero copied to clipboard
move fs implementations into sub packages
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.
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)
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.
Works for me! I definitely support sub-packaging when implementations have unique import requirements. I'm also not the maintainer, though :smile: