aboutsummaryrefslogtreecommitdiffstats
path: root/utils/fs/os
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-11-04 12:29:00 +0100
committerGitHub <noreply@github.com>2016-11-04 12:29:00 +0100
commit3a85c05bcf82ac4a6d48165bd644d81622fae80a (patch)
tree05f3d41ca6aa6d170dd61298f1d2fd047412ca78 /utils/fs/os
parent3f7fbc6c49e50eb22e3de8a5143817fa7c0c54dd (diff)
downloadgo-git-3a85c05bcf82ac4a6d48165bd644d81622fae80a.tar.gz
utils: fs, new memory filesystem (#108)
* utils: fs, new memory filesystem * utils: fs, renamed os.NewOS to os.New * utils: fs, memory changes requested by @alcortes
Diffstat (limited to 'utils/fs/os')
-rw-r--r--utils/fs/os/os.go6
-rw-r--r--utils/fs/os/os_test.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/utils/fs/os/os.go b/utils/fs/os/os.go
index 02395d6..3ff825e 100644
--- a/utils/fs/os/os.go
+++ b/utils/fs/os/os.go
@@ -14,8 +14,8 @@ type OS struct {
base string
}
-// NewOS returns a new OS filesystem
-func NewOS(baseDir string) *OS {
+// New returns a new OS filesystem
+func New(baseDir string) *OS {
return &OS{
base: baseDir,
}
@@ -139,7 +139,7 @@ func (fs *OS) Join(elem ...string) string {
// Dir returns a new Filesystem from the same type of fs using as baseDir the
// given path
func (fs *OS) Dir(path string) fs.Filesystem {
- return NewOS(fs.Join(fs.base, path))
+ return New(fs.Join(fs.base, path))
}
// Base returns the base path of the filesytem
diff --git a/utils/fs/os/os_test.go b/utils/fs/os/os_test.go
index 02a0a6c..756e284 100644
--- a/utils/fs/os/os_test.go
+++ b/utils/fs/os/os_test.go
@@ -21,7 +21,7 @@ var _ = Suite(&OSSuite{})
func (s *OSSuite) SetUpTest(c *C) {
s.path, _ = ioutil.TempDir(stdos.TempDir(), "go-git-os-fs-test")
- s.FilesystemSuite.Fs = os.NewOS(s.path)
+ s.FilesystemSuite.Fs = os.New(s.path)
}
func (s *OSSuite) TearDownTest(c *C) {
err := stdos.RemoveAll(s.path)