toolchain

package
v6.3.2 Latest Latest
Warning

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

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

Documentation

Overview

Package toolchain resolves system or Stroppy-owned Go compilers.

Index

Constants

View Source
const (
	PinnedVersion = "1.27.1"
)

Variables

View Source
var (
	ErrConsentRequired = errors.New(
		"private Go toolchain download requires consent; rerun in a terminal or pass -y",
	)
	ErrOfflineToolchainUnavailable = errors.New("compatible Go toolchain is unavailable offline")
	ErrUnsupportedHost             = errors.New("private Go toolchain is unavailable for this host")
)

Functions

func CleanPrivateCaches

func CleanPrivateCaches(root string) error

CleanPrivateCaches removes only Go caches owned by Stroppy's private toolchain.

Types

type Compiler

type Compiler struct {
	Path    string
	Version string
	Private bool
	Root    string
}

Compiler is one resolved Go executable and isolated build environment.

func Resolve

func Resolve(ctx context.Context, options Options) (*Compiler, error)

Resolve prefers a compatible system Go and falls back to a private pinned toolchain.

func (*Compiler) Env

func (compiler *Compiler) Env(targetOS, targetArch string, offline bool) []string

Env returns isolated Go environment while preserving process credentials and proxy policy.

type Consent uint8

Consent controls private toolchain acquisition.

const (
	ConsentAsk Consent = iota
	ConsentAlways
	ConsentNever
)

type Options

type Options struct {
	Root    string
	Consent Consent
	Input   io.Reader
	Output  io.Writer
	Offline bool
}

Options configures compiler resolution.

Jump to

Keyboard shortcuts

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