goenv

package
v0.212.4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 8 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 goenv resolves Go's configuration the way cmd/go does, without running go: even go env can write telemetry counters, and the callers (wb disk and wb disk prune's plan) must not write anything.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	GOCACHE     string
	GOMODCACHE  string
	GOPROXY     string
	GOSUMDB     string
	GOPRIVATE   string
	GONOPROXY   string
	GONOSUMDB   string
	GOFLAGS     string
	GOCACHEPROG string
}

Env is the subset of Go's configuration prune depends on, resolved without running go: even `go env` can write telemetry counters, and the plan must not write anything.

func Resolve

func Resolve() (Env, error)

Resolve resolves Go's settings the way cmd/go does, in order: the process environment, Go's environment file, the toolchain's own $GOROOT/go.env, then Go's documented default.

Jump to

Keyboard shortcuts

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