workspaceguard

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package workspaceguard guards design.md D1's go.work isolation decision: go.work declares which modules participate in the workspace and how dependency resolution works, but it does NOT make `go build ./...` or `go test -race ./...` from root traverse nested modules — each module must be tested/built explicitly (e.g., `cd providers/go && go test ./...`). This package enforces which modules may appear in the workspace via an explicit, automated allowlist rather than a comment. It parses go.work exactly once, the same way internal/daggerpin parses go.mod/dagger.json, and never requires a running Dagger engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaggerUse

func DaggerUse(usePaths []string) (string, bool)

DaggerUse reports the first `use` path (if any) whose cleaned path has a segment equal to ".dagger" or "dagger" -- the isolation design.md's D-B established for the .dagger/ Dagger-engine module, which D1 must never collapse by adding it to the workspace.

func ReplaceDirectives

func ReplaceDirectives(path string) ([]string, error)

ReplaceDirectives reads path (a go.mod file) and returns the set of replace directives it declares, each as "old => new" (with version or local path). An empty slice means no replace directives exist.

func UsePaths

func UsePaths(path string) ([]string, error)

UsePaths reads path (a go.work file) and returns the literal `use` directive paths it declares, in file order and exactly as written. It does not clean or normalize them, because the allowlist comparison (design.md D1) is against the literal committed content.

Types

This section is empty.

Jump to

Keyboard shortcuts

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