discover

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package discover lists the package closure used by one rask run.

Discovery sits on top of gotool.Tool. It resolves the user's patterns into selected packages, loads the local package closure needed for fingerprinting, and rejects load errors before hashing starts.

Packages returns a finished slice instead of streaming on a channel because `go list` already materializes discovery as a batch. The old stream only replayed a completed slice, which made cancellation and ownership harder to reason about without reducing memory use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoWorkPath

func GoWorkPath(environment []byte) string

GoWorkPath centralizes GOWORK semantics so root discovery stays deterministic.

func LocalModuleRoots

func LocalModuleRoots(
	ctx context.Context,
	tool gotool.Tool,
	module gotool.Module,
) ([]string, error)

LocalModuleRoots uses go env once so workspace state matches this run.

func LocalModuleRootsFromEnvironment

func LocalModuleRootsFromEnvironment(
	ctx context.Context,
	tool gotool.Tool,
	module gotool.Module,
	environment []byte,
) ([]string, error)

LocalModuleRootsFromEnvironment avoids a second go env for cache salting.

func LocalReplaceRoots

func LocalReplaceRoots(root string) ([]string, error)

LocalReplaceRoots avoids x/mod so discovery keeps its zero-dependency contract.

func Packages added in v0.5.0

func Packages(
	ctx context.Context,
	tool gotool.Tool,
	module gotool.Module,
	patternDir string,
	patterns []string,
) ([]gotool.Package, error)

Packages returns a full run universe because go list already materializes it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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