Documentation
¶
Overview ¶
Package util is the plumbing the file tools share: paths, walking, globs, and search results.
Index ¶
- Constants
- func MatchGlob(pattern string, name string) bool
- func RenderSearch(pattern string, path string, globPattern string) (string, string)
- func Report(matches []string, truncated bool) string
- func RootName(root *file.Root, path string) (string, error)
- func SearchPath(call tool.Call) string
- func Walk(filesystem fs.FS, root string, ...) error
Constants ¶
const MaxMatches = 100
MaxMatches caps what a search hands back.
Variables ¶
This section is empty.
Functions ¶
func MatchGlob ¶
MatchGlob reports whether name, a slash-separated relative path, matches pattern. '*', '?' and '[...]' are path.Match within one segment, and '**' as a whole segment matches zero or more of them.
func RenderSearch ¶
RenderSearch describes a search out loud, as the pattern and what qualifies it. A search taking no glob passes an empty string, and the working directory goes without saying.
func RootName ¶
RootName turns a tool-supplied path into the relative name Root's own methods take. It rejects a name that plainly leaves the root; Root re-validates the name when it is opened.
func SearchPath ¶
SearchPath returns the final component of the path in a rendered search call.
Types ¶
This section is empty.