From 5f2e1cb8969c2adac6c866b57cc331e1bc16d4e9 Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Thu, 6 Sep 2018 14:21:18 -0500 Subject: 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 --- hugofs/noop_fs.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'hugofs/noop_fs.go') 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 } -- cgit v1.2.3