workspace

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package workspace validates and contains access to a configured Go workspace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Toolchain

type Toolchain struct {
	Path    string `json:"path"`
	Version string `json:"version"`
}

Toolchain is the effective Go executable selected from the process PATH.

type Workspace

type Workspace struct {
	// contains filtered or unexported fields
}

Workspace is a validated, symlink-resolved Go workspace root.

func Open

func Open(ctx context.Context, root string) (*Workspace, error)

Open validates root as a directory in an active Go module or workspace.

func (*Workspace) Relative

func (w *Workspace) Relative(path string) (string, error)

Relative returns an existing contained path relative to the workspace root.

func (*Workspace) RequiredGo

func (w *Workspace) RequiredGo() string

RequiredGo returns the highest Go version required by the active workspace.

func (*Workspace) Resolve

func (w *Workspace) Resolve(path string) (string, error)

Resolve resolves an existing path and rejects anything outside the workspace.

func (*Workspace) Root

func (w *Workspace) Root() string

Root returns the absolute, symlink-resolved workspace root.

func (*Workspace) Toolchain

func (w *Workspace) Toolchain() Toolchain

Toolchain returns the immutable effective Go toolchain recorded at preflight.

Jump to

Keyboard shortcuts

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