mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
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
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
c8ce65046d
commit
5f2e1cb896
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user