goversion

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: 0BSD Imports: 6 Imported by: 0

Documentation

Overview

Package goversion resolves and validates the Go source language version for one project path without invoking the Go command.

Index

Constants

View Source
const (
	// Minimum is the oldest source language supported by this Gox release line.
	Minimum = "go1.25"
	// Maximum is the newest source language supported by this Gox release line.
	Maximum = "go1.26"
	// Default applies when no project language directive is available.
	Default = Maximum
)

Variables

This section is empty.

Functions

func IsFilesystemError

func IsFilesystemError(err error) bool

IsFilesystemError reports whether resolving the source version failed while inspecting or reading the filesystem rather than because of project policy.

Types

type Selection

type Selection struct {
	Language string
	Path     string
}

Selection is the normalized source language and the directive that selected it. Path is empty when the documented default applies.

func Resolve

func Resolve(inputPath, root string) (Selection, error)

Resolve selects the nearest owning go.mod, then the project go.work, and finally Default. inputPath may identify a file that does not exist yet.

Jump to

Keyboard shortcuts

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