Documentation
¶
Overview ¶
Package context provides error constructors for context directory operations, including typed errors for errors.As matching.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirSymlink ¶
DirSymlink returns an error when .context/ is a symlink.
Parameters:
- dir: the context directory path
Returns:
- error: "context directory <dir> is a symlink"
func FileSymlink ¶
FileSymlink returns an error when a file inside .context/ is a symlink.
Parameters:
- file: the symlinked file path
Returns:
- error: "context file <file> is a symlink"
func OutsideRoot ¶
OutsideRoot returns an error when .context/ resolves outside the project root.
Parameters:
- dir: the context directory path
- root: the project root path
Returns:
- error: "context directory <dir> resolves outside project root <root>"
Types ¶
type NotFoundError ¶
type NotFoundError struct {
Dir string
}
NotFoundError is returned when the context directory does not exist.
func NotFound ¶
func NotFound(dir string) *NotFoundError
NotFound returns a NotFoundError for the given directory.
Parameters:
- dir: path to the missing context directory
Returns:
- *NotFoundError: typed error for errors.As matching
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface for NotFoundError.
Returns:
- string: Error message including the missing directory path
Click to show internal directories.
Click to hide internal directories.