stdmod

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package stdmod redirects stdlib-shaped import paths to a std module hosted on the Go module proxy. The mvm binary embeds a proxy-format zip of this module as an offline floor.

Index

Constants

View Source
const (
	ModulePath = "github.com/mvm-sh/std"
	Version    = "v0.1.0"
)

ModulePath and Version pin the std module shipped with mvm. The embedded src.zip must match these values so that modfs.Inject keys the module under the same path.

Variables

This section is empty.

Functions

func DefaultFS

func DefaultFS() fs.FS

DefaultFS returns a stdlib redirect FS backed by an offline modfs pre-populated with the embedded std zip.

func FS

func FS(backing *modfs.FS) fs.FS

FS returns an fs.FS that serves stdlib-shaped imports by rewriting them to "<modPath>/<path>" against the given backing modfs. Non-stdlib imports return fs.ErrNotExist.

func IsStdlibImport

func IsStdlibImport(path string) bool

IsStdlibImport reports whether path looks like a Go stdlib import.

func Resolve

func Resolve() (modPath, version string)

Resolve returns the active std module path and version, applying any MVMSTD override in the format "<ModulePath>@<Version>".

Types

This section is empty.

Jump to

Keyboard shortcuts

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