package modload

import "cuelang.org/go/internal/mod/modload"

Index

Functions

func Tidy

func Tidy(ctx context.Context, fsys fs.FS, modRoot string, reg Registry, cueVers string) (*modfile.File, error)

Tidy evaluates all the requirements of the given main module, using the given registry to download requirements and returns a resolved and tidied module file. If there's no language version in the module file and cueVers is non-empty it will be used to populate the language version field.

func UpdateVersions

func UpdateVersions(ctx context.Context, fsys fs.FS, modRoot string, reg Registry, versions []string) (*modfile.File, error)

UpdateVersions returns the main module's module file with the specified module versions updated if possible and added if not already present. It returns an error if asked to downgrade a module below a version already required by an external dependency.

A module in the versions slice can be specified as one of the following:

Types

type Registry

type Registry interface {
	modrequirements.Registry
	modpkgload.Registry
	// ModuleVersions returns all the versions for the module with the given path
	// sorted in semver order.
	// If mpath has a major version suffix, only versions with that major version will
	// be returned.
	ModuleVersions(ctx context.Context, mpath string) ([]string, error)
}

Registry is modload's view of a module registry.

Source Files

load.go query.go

Version
v0.8.0-alpha.5
Published
Mar 4, 2024
Platform
windows/amd64
Imports
19 packages
Last checked
3 hours ago

Tools for package owners.