Documentation
¶
Overview ¶
Package goversion decides which Go features the generated code may use, from the go directive of the project and the toolchain installed on the machine.
Index ¶
- Constants
- func LatestVersion() string
- func Max(a, b string) string
- func NormalizeGoVersion(goversion string) (string, error)
- func Supported(goVersion string) bool
- func UpgradeTarget(local string) string
- type Capabilities
- type ModFile
- type Status
- type Target
- type Toolchain
- type ToolchainCheck
- type WorkFile
Constants ¶
const MinimumRelease = "1.26"
Variables ¶
This section is empty.
Functions ¶
func LatestVersion ¶
func LatestVersion() string
func NormalizeGoVersion ¶
func UpgradeTarget ¶
UpgradeTarget picks the version to move a project to when its go directive is too old. We prefer the toolchain the user already has over the newest release, so nothing has to be downloaded just to build.
Types ¶
type Capabilities ¶
type Capabilities struct {
Release string `json:"release"`
StdUUID bool `json:"stdUUID"`
JSONv2 bool `json:"jsonV2"`
}
func Known ¶
func Known() []Capabilities
func Latest ¶
func Latest() Capabilities
func (Capabilities) Enabled ¶
func (c Capabilities) Enabled() []string
func (Capabilities) JSONImport ¶
func (c Capabilities) JSONImport() string
func (Capabilities) String ¶
func (c Capabilities) String() string
func (Capabilities) UUIDImport ¶
func (c Capabilities) UUIDImport() string
type ModFile ¶
func (*ModFile) RequiredToolchain ¶
type Target ¶
type Target struct {
GoVersion string `json:"goVersion"`
Toolchain string `json:"toolchain,omitempty"`
Status Status `json:"status"`
Caps Capabilities `json:"capabilities"`
Warnings []string `json:"warnings,omitempty"`
}
type Toolchain ¶
type Toolchain struct {
Local string `json:"local"`
Setting string `json:"setting"`
Experiment string `json:"experiment,omitempty"`
}
func (Toolchain) Check ¶
func (tc Toolchain) Check(required string) ToolchainCheck
func (Toolchain) ExperimentWarning ¶
func (tc Toolchain) ExperimentWarning(c Capabilities) string