context

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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(dir string) error

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(file string) error

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

func OutsideRoot(dir, root string) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL