github.com/chenfeining/golangci-lint@v1.0.2-0.20230730162517-14c6c67868df/pkg/packages/skip.go (about) 1 package packages 2 3 import ( 4 "fmt" 5 "path/filepath" 6 "regexp" 7 ) 8 9 func pathElemReImpl(e string, sep rune) string { 10 escapedSep := regexp.QuoteMeta(string(sep)) // needed for windows sep '\\' 11 return fmt.Sprintf(`(^|%s)%s($|%s)`, escapedSep, e, escapedSep) 12 } 13 14 func pathElemRe(e string) string { 15 return pathElemReImpl(e, filepath.Separator) 16 } 17 18 var StdExcludeDirRegexps = []string{ 19 pathElemRe("vendor"), 20 pathElemRe("third_party"), 21 pathElemRe("testdata"), 22 pathElemRe("examples"), 23 pathElemRe("Godeps"), 24 pathElemRe("builtin"), 25 }