goinfo

package
v1.0.37 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGoModDoesNotHaveModule = errors.New("go.mod does not have module")
View Source
var ErrGoModNotFound = errors.New("go.mod not found")

Functions

func CmpInt added in v1.0.26

func CmpInt(x, y string) int

func CompareSemVer added in v1.0.26

func CompareSemVer(v, w string) int

func CompareVersion added in v1.0.26

func CompareVersion(x, y string) int

func FindGoModDir added in v1.0.37

func FindGoModDir(dir string) (string, error)

func FromToolchain added in v1.0.26

func FromToolchain(name string) string

func GetGoVersionOutput

func GetGoVersionOutput(goBinary string) (string, error)

func GetModPath added in v1.0.37

func GetModPath(dir string) (string, error)

func IsValidSemVer added in v1.0.26

func IsValidSemVer(v string) bool

func IsValidVersion added in v1.0.26

func IsValidVersion(x string) bool

func ModCompare added in v1.0.26

func ModCompare(path string, x, y string) int

func ResolveMainModule added in v1.0.19

func ResolveMainModule(dir string, args []string) (subPaths []string, mainModule string, err error)

Types

type GoVersion

type GoVersion struct {
	Major int // 1
	Minor int // 17
	Patch int // 5

	OS   string
	Arch string
}

func ParseGoVersion

func ParseGoVersion(s string) (*GoVersion, error)

func ParseGoVersionNumber added in v1.0.37

func ParseGoVersionNumber(version string) (*GoVersion, error)

func (*GoVersion) String

func (c *GoVersion) String() string

type ModVersion added in v1.0.26

type ModVersion struct {
	Path    string
	Version string
}

type VendorInfo added in v1.0.26

type VendorInfo struct {
	VendorList      []ModVersion          // modules that contribute packages to the build, in order of appearance
	VendorReplaced  []ModVersion          // all replaced modules; may or may not also contribute packages
	VendorVersion   map[string]string     // module path → selected version (if known)
	VendorPkgModule map[string]ModVersion // package → containing module
	VendorMeta      map[ModVersion]vendorMetadata
	// contains filtered or unexported fields
}

func ParseVendor added in v1.0.26

func ParseVendor(dirOrFile string) (*VendorInfo, error)

ParseVendor reads the list of vendored modules from vendor/modules.txt.

func ParseVendorContent added in v1.0.26

func ParseVendorContent(content string) *VendorInfo

type Version added in v1.0.26

type Version struct {
	Major string // decimal
	Minor string // decimal or ""
	Patch string // decimal or ""
	Kind  string // "", "alpha", "beta", "rc"
	Pre   string // decimal or ""
}

see: https://cs.opensource.google/go/go/+/master:src/internal/gover/gover.go

func ParseVersion added in v1.0.26

func ParseVersion(x string) Version

Jump to

Keyboard shortcuts

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