mod

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGoVersion

func GetGoVersion() (string, error)

func GetParentPackage added in v0.25.0

func GetParentPackage(workDir string) (string, error)

GetParentPackage if is submodule project, root package is based on go.mod and add its dir

func UpdateImportedModule added in v0.28.0

func UpdateImportedModule(f *ast.File, fset *token.FileSet, workDir, module string) error

Types

type ModuleStruct

type ModuleStruct struct {
	Path      string
	Dir       string
	GoVersion string
}

ModuleStruct contains the relative data of go module, which is the result of the command go list

func GetGoMod

func GetGoMod(workDir string) (*ModuleStruct, error)

GetGoMod is used to determine whether workDir is a go module project through command `go list -json -m`

func GetGoMods added in v0.28.0

func GetGoMods(workDir string) ([]ModuleStruct, error)

Jump to

Keyboard shortcuts

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