resolve

package
v0.0.102 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRootModulePath added in v0.0.85

func GetRootModulePath(targetDir string) (string, error)

GetRootModulePath gets the module path from the go.mod at the root of the git repository

func GoResolveVersion added in v0.0.25

func GoResolveVersion(dir string, modPath string, version string) (string, error)

resolve version to a normalized version representation

func ResolveLocalModules added in v0.0.90

func ResolveLocalModules(currentDir string, localModDirs []string) (*ModuleInfo, []*LocalModuleInfo, error)

ResolveLocalModules resolves a list of local module directories and checks their dependency status against the current directory's go.mod file.

func ResolveModPathFromPossibleDir

func ResolveModPathFromPossibleDir(dirOrModPath string) (dir string, modPath string, err error)

Types

type LocalModuleInfo added in v0.0.90

type LocalModuleInfo struct {
	LocalPath      string      // Local filesystem path (absolute)
	ModuleInfo     *ModuleInfo // Module information from go.mod
	IsDependency   bool        // Whether this module is a dependency of the current module
	IsReplaced     bool        // Whether this module is currently replaced
	CurrentVersion string      // Current version in go.mod (if it's a dependency)
}

LocalModuleInfo represents information about a resolved local module

type ModuleInfo

type ModuleInfo struct {
	Module struct {
		Path string `json:"Path"`
	} `json:"Module"`
	Require []struct {
		Path    string `json:"Path"`
		Version string `json:"Version"`
	} `json:"Require"`
	Replace []struct {
		Old struct {
			Path string `json:"Path"`
		} `json:"Old"`
		New struct {
			Path    string `json:"Path"`
			Version string `json:"Version"`
		} `json:"New"`
	} `json:"Replace"`
}

func GetModuleInfo

func GetModuleInfo(dir string) (*ModuleInfo, error)

Jump to

Keyboard shortcuts

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