diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 7d4d6317270968bd853fc5bff381f4d7fa90b986..0000000000000000000000000000000000000000 --- a/.drone.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -kind: pipeline -name: compliance -trigger: - event: - - pull_request -steps: - - name: build - pull: always - image: golang:1.16 - commands: - - make test - - name: check - pull: always - image: golang:1.16 - commands: - - make vet \ No newline at end of file diff --git a/README.md b/README.md index 4f0db5a95038aa5b8f58cec3b0c80bce1bcccf0a..2f32c46f2b5a669669b08efc6e6a4d84fbcad2a6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,4 @@ # Overlay - -[![Build Status](https://ci.jojodev.com/api/badges/jolheiser/overlay/status.svg?ref=refs/heads/main)](https://ci.jojodev.com/jolheiser/overlay) - Overlay File System Overlay is an easy way to implement a file system in such a way that diff --git a/overlay.go b/overlay.go index 512bf1c77ece17e9cc8deba0777e8c8ea60d8e10..8dab55d4f2bfc65b08fb7b47be9f2b02bffbca84 100644 --- a/overlay.go +++ b/overlay.go @@ -6,10 +6,6 @@ "os" "path" ) -// Interface guard -// fs.ReadFileFS also fulfills fs.FS -var _ fs.ReadFileFS = (*FS)(nil) - // FS is an overlay File System type FS struct { fs fs.FS @@ -44,15 +40,6 @@ return f.fs.Open(name) } import ( - "os" -func (f *FS) ReadFile(name string) ([]byte, error) { - if f.exists(name) { - return os.ReadFile(f.apn(name)) - } - return fs.ReadFile(f.fs, name) -} - -import ( // fs.ReadFileFS also fulfills fs.FS // This method will prefer EMBEDDED, because that is the "real" FS for overlay func (f *FS) ReadDir(name string) ([]fs.DirEntry, error) { @@ -78,15 +65,6 @@ } } return x, nil -} - -// MustNew returns New and panics on error -func MustNew(root string, fs fs.FS, opts ...Option) *FS { - f, err := New(root, fs, opts...) - if err != nil { - panic(err) - } - return f } // WithSub sets a fs.Sub for an FS diff --git a/overlay_test.go b/overlay_test.go index 80ce9189c6af47c7ba0ebf5414a700ecc83bacc6..07ec8d203d4ec7feb418e99987c7f6938d9820e8 100644 --- a/overlay_test.go +++ b/overlay_test.go @@ -2,6 +2,7 @@ package overlay import ( "embed" + "io" "io/fs" "os" "strings" @@ -48,7 +49,7 @@ t.FailNow() } defer fi.Close() - contents, err := x.ReadFile(tc.File) + contents, err := io.ReadAll(fi) if err != nil { t.Log(err) t.FailNow()