From 8c12c6939aab9106db14ec2d11d983bc5b29fb2c Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Sun, 7 Jul 2019 21:33:44 +0100 Subject: Switch to modules --- vendor/github.com/homemade/scl/disk_file_system.go | 53 ---------------------- 1 file changed, 53 deletions(-) delete mode 100644 vendor/github.com/homemade/scl/disk_file_system.go (limited to 'vendor/github.com/homemade/scl/disk_file_system.go') diff --git a/vendor/github.com/homemade/scl/disk_file_system.go b/vendor/github.com/homemade/scl/disk_file_system.go deleted file mode 100644 index edd11f0..0000000 --- a/vendor/github.com/homemade/scl/disk_file_system.go +++ /dev/null @@ -1,53 +0,0 @@ -package scl - -import ( - "io" - "os" - "path/filepath" - "strings" - "time" -) - -type diskFileSystem struct { - basePath string -} - -/* -NewDiskSystem creates a filesystem that uses the local disk, at an optional -base path. The default base path is the current working directory. -*/ -func NewDiskSystem(basePath ...string) FileSystem { - - base := "" - - if len(basePath) > 0 { - base = basePath[0] - } - - return &diskFileSystem{base} -} - -func (d *diskFileSystem) path(path string) string { - return filepath.Join(d.basePath, strings.TrimPrefix(path, d.basePath)) -} - -func (d *diskFileSystem) Glob(pattern string) (out []string, err error) { - return filepath.Glob(d.path(pattern)) -} - -func (d *diskFileSystem) ReadCloser(path string) (data io.ReadCloser, lastModified time.Time, err error) { - - reader, err := os.Open(d.path(path)) - - if err != nil { - return nil, time.Time{}, err - } - - stat, err := reader.Stat() - - if err != nil { - return nil, time.Time{}, err - } - - return reader, stat.ModTime(), nil -} -- cgit v1.2.3