workspace

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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