Skip to content

Commit 895872a

Browse files
committed
fix: lint issues
1 parent 1e3959c commit 895872a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tarfs/tarfs.go

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

templates.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func readDir(src string, files fs.FS) ([]fs.DirEntry, error) {
169169
}
170170

171171
if !fi.IsDir() {
172-
return nil, errors.New(fmt.Sprintf("%v must be a directory", fi.Name()))
172+
return nil, fmt.Errorf("%v must be a directory", fi.Name())
173173
}
174174
list, err := f.(fs.ReadDirFile).ReadDir(-1)
175175
if err != nil {

0 commit comments

Comments
 (0)