fix: lint issues

This commit is contained in:
Luke Kingland 2021-03-25 23:46:12 +09:00
parent 1e3959c045
commit 895872aee7
No known key found for this signature in database
GPG Key ID: 4896F75BAF2E1966
2 changed files with 4 additions and 4 deletions

View File

@ -68,9 +68,9 @@ func (fsys FS) Open(name string) (fs.File, error) {
// Note that file can be nil here: the map need not contain explicit parent directories for all its files.
// But file can also be non-nil, in case the user wants to set metadata for the directory explicitly.
// Either way, we need to construct the list of children of this directory.
var list []fileInfo
var elem string
var need = make(map[string]bool)
list := []fileInfo{}
elem := ""
need := make(map[string]bool)
if name == "." {
elem = "."
for fname, f := range fsys {

View File

@ -169,7 +169,7 @@ func readDir(src string, files fs.FS) ([]fs.DirEntry, error) {
}
if !fi.IsDir() {
return nil, errors.New(fmt.Sprintf("%v must be a directory", fi.Name()))
return nil, fmt.Errorf("%v must be a directory", fi.Name())
}
list, err := f.(fs.ReadDirFile).ReadDir(-1)
if err != nil {