Documentation
¶
Overview ¶
Package upgrade moves a project to another platform version.
The new version is required in go.mod, recorded in platformgo.yaml, and then applied by the new version itself through go tool: only it knows its generated files, its tools, its codemods and its checks. Afterwards the project is built, verified and tested. A dry run does all of it in a copy of the project and prints the plan.
Index ¶
Constants ¶
View Source
const Module = "github.com/aidarbn/platform-go"
Module is the Go module of the platform.
View Source
const Tool = Module + "/cmd/platformgo"
Tool is the package of the platform tool the project runs with go tool.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶ added in v0.9.0
type Check struct {
Name string
Args []string // of the go command
Err error
Output string // of a dry run
}
Check is a command run after the upgrade.
type Options ¶ added in v0.9.0
type Options struct {
Version string // a tag, or latest when empty
DryRun bool // upgrade a copy of the project and print the plan; the project stays as it is
NoCheck bool // skip go build, platformgo verify and go test after the upgrade
// Strict fails the upgrade when a check fails. Without it a failed check is a
// warning and the upgrade succeeds, as it did before the checks existed.
Strict bool
}
Options say how to upgrade.
type Result ¶
type Result struct {
From, To string
Untidy string // go mod tidy -diff before the upgrade: what apply would tidy on top of it
TidyErr string // go mod tidy -diff could not run: the reason
Plan string // platformgo plan of the new version, in a dry run
Checks []Check // run after the upgrade
}
Result says what changed.
Click to show internal directories.
Click to hide internal directories.