Documentation
¶
Overview ¶
Package modfiles enumerates Go source files owned by this module while excluding structural directories and nested repository or module boundaries.
Index ¶
Constants ¶
const ( // ReasonVendor is a vendored dependency tree. No repository in this // workspace vendors; Go also ignores vendor/ when a workspace is active. ReasonVendor = "vendor" // ReasonTestdata is Go's testdata convention: never part of a build. ReasonTestdata = "testdata" // ReasonDotPrefixed and ReasonUnderscorePrefixed are the names the Go tool // itself ignores, which is why they are sound to skip here. ReasonDotPrefixed = "dot-prefixed" ReasonUnderscorePrefixed = "underscore-prefixed" )
The reasons the walk refuses a path. They are exported because a guard that polices this walk must be able to report WHICH rule hid a file, and must be unable to fall behind when a rule is added.
Variables ¶
This section is empty.
Functions ¶
func BoundaryMarkers ¶
func BoundaryMarkers() []string
BoundaryMarkers returns the marker filenames that stop the walk at a nested module or repository. The slice is a copy: a caller pinning this set must not be able to change it.
It is exported so a guard can enumerate the markers rather than restate them. A restated copy is a second implementation of "what is a boundary", and two such implementations have already disagreed here: one recognised only a .git DIRECTORY while this walk stops at a .git FILE too, which is what `git submodule add` and `git worktree add` write.
func Files ¶
Files returns absolute paths to every module-owned Go source file below root. Build constraints are deliberately ignored so tagged production files remain visible to dependency and formatting checks.
func IgnoredDirectory ¶
IgnoredDirectory reports whether the walk refuses to descend into a directory with this name, and why.
The reason is returned, not just the verdict, because a guard reporting a hidden subtree must say which rule hid it — and because a rule added here without a reason cannot be reported at all, which is the failure this signature exists to make impossible.
func IgnoredFile ¶
IgnoredFile reports whether the walk refuses to read a file with this name, and why. Go ignores these names too, so a Go file behind one is not part of any build.
Types ¶
type SymlinkError ¶
type SymlinkError struct {
Path string
}
SymlinkError reports a module-owned Go source path that is a symbolic link. Discovery fails closed rather than following a link that may escape the module.
func (*SymlinkError) Error ¶
func (e *SymlinkError) Error() string