goversion

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGitHubRepo

func IsGitHubRepo(modulePath string) bool

IsGitHubRepo checks if the module path starts with "github.com/".

func ParseGitHubRepo

func ParseGitHubRepo(modulePath string) (owner string, repo string, err error)

ParseGitHubRepo extracts the owner and repo from a "github.com/owner/repo" path.

Types

type DefaultRunner

type DefaultRunner struct{}

DefaultRunner implements Runner by executing the go version command.

func (*DefaultRunner) GetInfo

func (d *DefaultRunner) GetInfo(binaryName string) (*Info, error)

GetInfo runs go version -m -json against the named binary and returns its Info.

type Info

type Info struct {
	Path      string
	Version   string
	GoVersion string
}

Info holds version information about an installed Go binary.

func ParseVersionJSON

func ParseVersionJSON(data []byte) (*Info, error)

ParseVersionJSON parses the JSON output from go version -m -json into Info.

type Runner

type Runner interface {
	GetInfo(binaryName string) (*Info, error)
}

Runner is an interface for retrieving version info from Go binaries.

Jump to

Keyboard shortcuts

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