summaryrefslogtreecommitdiffstats
path: root/hugofs/noop_fs.go
diff options
context:
space:
mode:
authorCameron Moore <moorereason@gmail.com>2018-09-06 14:21:18 -0500
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-09-07 08:25:51 +0200
commit5f2e1cb8969c2adac6c866b57cc331e1bc16d4e9 (patch)
treeca4ceccceed92f9be53d44c889789c902f62fd1e /hugofs/noop_fs.go
parentc8ce65046dc7539f3bf5f6dd35fa7ece2bec866d (diff)
hugofs: Fix golint issues
Fix godoc issues and the following: hugofs/noop_fs.go:25:2: error var noOpErr should have name of the form errFoo
Diffstat (limited to 'hugofs/noop_fs.go')
-rw-r--r--hugofs/noop_fs.go23
1 files changed, 13 insertions, 10 deletions
diff --git a/hugofs/noop_fs.go b/hugofs/noop_fs.go
index 2d06622e4..c3d2f2da5 100644
--- a/hugofs/noop_fs.go
+++ b/hugofs/noop_fs.go
@@ -22,24 +22,27 @@ import (
)
var (
- noOpErr = errors.New("this is a filesystem that does nothing and this operation is not supported")
+ errNoOp = errors.New("this is a filesystem that does nothing and this operation is not supported")
_ afero.Fs = (*noOpFs)(nil)
- NoOpFs = &noOpFs{}
+
+ // NoOpFs provides a no-op filesystem that implements the afero.Fs
+ // interface.
+ NoOpFs = &noOpFs{}
)
type noOpFs struct {
}
func (fs noOpFs) Create(name string) (afero.File, error) {
- return nil, noOpErr
+ return nil, errNoOp
}
func (fs noOpFs) Mkdir(name string, perm os.FileMode) error {
- return noOpErr
+ return errNoOp
}
func (fs noOpFs) MkdirAll(path string, perm os.FileMode) error {
- return noOpErr
+ return errNoOp
}
func (fs noOpFs) Open(name string) (afero.File, error) {
@@ -51,15 +54,15 @@ func (fs noOpFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File,
}
func (fs noOpFs) Remove(name string) error {
- return noOpErr
+ return errNoOp
}
func (fs noOpFs) RemoveAll(path string) error {
- return noOpErr
+ return errNoOp
}
func (fs noOpFs) Rename(oldname string, newname string) error {
- return noOpErr
+ return errNoOp
}
func (fs noOpFs) Stat(name string) (os.FileInfo, error) {
@@ -71,9 +74,9 @@ func (fs noOpFs) Name() string {
}
func (fs noOpFs) Chmod(name string, mode os.FileMode) error {
- return noOpErr
+ return errNoOp
}
func (fs noOpFs) Chtimes(name string, atime time.Time, mtime time.Time) error {
- return noOpErr
+ return errNoOp
}