upgrade

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package upgrade brings projects generated by older GOT versions up to date.

Steps detect their need from the project files rather than from a recorded version, so they also work for projects created before got-project.json existed. A step only rewrites code that still matches what GOT generated; when a developer has changed it, the step reports a manual action instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(project string, results []Result) error

Apply writes the changes of every pending result. Each file keeps its mode.

Types

type Result

type Result struct {
	ID          string            `json:"id"`
	Description string            `json:"description"`
	Status      Status            `json:"status"`
	Detail      string            `json:"detail,omitempty"`
	Changes     map[string][]byte `json:"-"`
	Files       []string          `json:"files,omitempty"`
}

Result describes one step for one project. Changes maps project-relative paths to their complete new content.

func Plan

func Plan(project, version string) ([]Result, error)

Plan evaluates every step against the project without writing anything.

func PlanWorkspace added in v1.1.1

func PlanWorkspace(root string) ([]Result, error)

PlanWorkspace evaluates workspace-level files. In workspace mode the go.work toolchain directive, not each go.mod, selects the toolchain.

type Status

type Status string
const (
	StatusPending  Status = "pending"
	StatusUpToDate Status = "up-to-date"
	StatusManual   Status = "manual"
)

Jump to

Keyboard shortcuts

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