goversion

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
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.

Jump to

Keyboard shortcuts

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