Remove unnecessary wrapping of function call

This commit is contained in:
shubhendra 2021-02-25 15:58:43 +05:30
parent ec0e382e11
commit 9a17c76718
No known key found for this signature in database
GPG Key ID: 9AFEF5C98D542137
3 changed files with 3 additions and 9 deletions

View File

@ -211,9 +211,7 @@ func (fp *FileProvider) SessionGC(context.Context) {
// it walks save path to count files.
func (fp *FileProvider) SessionAll(context.Context) int {
a := &activeSession{}
err := filepath.Walk(fp.savePath, func(path string, f os.FileInfo, err error) error {
return a.visit(path, f, err)
})
err := filepath.Walk(fp.savePath, a.visit)
if err != nil {
SLogger.Printf("filepath.Walk() returned %v\n", err)
return 0

View File

@ -202,9 +202,7 @@ func BuildTemplate(dir string, files ...string) error {
root: dir,
files: make(map[string][]string),
}
err = Walk(fs, dir, func(path string, f os.FileInfo, err error) error {
return self.visit(path, f, err)
})
err = Walk(fs, dir, self.visit)
if err != nil {
fmt.Printf("Walk() returned %v\n", err)
return err

View File

@ -287,9 +287,7 @@ func _filePath(dir, name string) string {
}
func assetFS() *assetfs.AssetFS {
assetInfo := func(path string) (os.FileInfo, error) {
return os.Stat(path)
}
assetInfo := os.Stat
for k := range _bintree.Children {
return &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: assetInfo, Prefix: k}
}