package goversion

import "cuelang.org/go/internal/golangorgx/gopls/util/goversion"

Package goversions defines gopls's policy for which versions of Go it supports.

Index

Variables

var Supported = []Support{
	{12, "", "v0.7.5"},
	{15, "", "v0.9.5"},
	{16, "", "v0.11.0"},
	{17, "", "v0.11.0"},
	{18, "v0.16.0", "v0.14.2"},
}

Supported maps Go versions to the gopls version in which support will be deprecated, and the final gopls version supporting them without warnings. Keep this in sync with gopls/README.md.

Must be sorted in ascending order of Go version.

Exposed (and mutable) for testing.

Functions

func Message

func Message(goVersion int, fromBuild bool) (string, bool)

Message returns the message to display if the user has the given Go version, if any. The goVersion variable is the X in Go 1.X. If fromBuild is set, the Go version is the version used to build gopls. Otherwise, it is the go command version.

The second component of the result indicates whether the message is an error, not a mere warning.

If goVersion is invalid (< 0), it returns "", false.

func OldestSupported

func OldestSupported() int

OldestSupported is the last X in Go 1.X that this version of gopls supports without warnings.

Exported for testing.

Types

type Support

type Support struct {
	// GoVersion is the Go version to which these settings relate.
	GoVersion int

	// DeprecatedVersion is the first version of gopls that no longer supports
	// this Go version.
	//
	// If unset, the version is already deprecated.
	DeprecatedVersion string

	// InstallGoplsVersion is the latest gopls version that supports this Go
	// version without warnings.
	InstallGoplsVersion string
}

Support holds information about end-of-life Go version support.

Exposed for testing.

Source Files

goversion.go

Version
v0.9.0-alpha.1
Published
Mar 21, 2024
Platform
linux/amd64
Imports
2 packages
Last checked
27 minutes ago

Tools for package owners.