mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 23:42:10 +08:00
pkg/util/{filepath.go,shortid_generator.go}: Fix golint issues
See, $ gometalinter --vendor --deadline 10m --disable-all --enable=golint ./... filepath.go:12:5⚠️ error var WalkSkipDir should have name of the form ErrFoo (golint) shortid_generator.go:11:5⚠️ var validUidPattern should be validUIDPattern (golint) shortid_generator.go:19:6⚠️ func IsValidShortUid should be IsValidShortUID (golint) shortid_generator.go:24:6⚠️ func GenerateShortUid should be GenerateShortUID (golint)
This commit is contained in:
@ -8,8 +8,8 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
//WalkSkipDir is the Error returned when we want to skip descending into a directory
|
||||
var WalkSkipDir = errors.New("skip this directory")
|
||||
//ErrWalkSkipDir is the Error returned when we want to skip descending into a directory
|
||||
var ErrWalkSkipDir = errors.New("skip this directory")
|
||||
|
||||
//WalkFunc is a callback function called for each path as a directory is walked
|
||||
//If resolvedPath != "", then we are following symbolic links.
|
||||
@ -50,7 +50,7 @@ func walk(path string, info os.FileInfo, resolvedPath string, symlinkPathsFollow
|
||||
}
|
||||
err := walkFn(resolvedPath, info, nil)
|
||||
if err != nil {
|
||||
if info.IsDir() && err == WalkSkipDir {
|
||||
if info.IsDir() && err == ErrWalkSkipDir {
|
||||
err = nil
|
||||
}
|
||||
return err
|
||||
|
Reference in New Issue
Block a user