mod

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotAGoyaveProject returned when the go project found doesn't import Goyave
	ErrNotAGoyaveProject = errors.New("Current project doesn't import Goyave")

	// ErrNoGoMod returned when no go.mod file can be found
	ErrNoGoMod = errors.New("No go.mod found")
)

Functions

func FindDependency

func FindDependency(modFile *modfile.File, dependencyPath string) *modfile.Require

FindDependency find the required dependency identified by the given dependencyPath (like "golang.org/x/text" or "rsc.io/quote/v2") in the given modFile requires, or nil.

func FindGoyaveRequire

func FindGoyaveRequire(modFile *modfile.File) *modfile.Require

FindGoyaveRequire find the first Goyave occurrence in the given modFile's requires, or nil.

func FindParentModule

func FindParentModule() string

FindParentModule tries to find the ascending relative path to the nearest directory containing a "go.mod" file, or an empty string.

func Parse

func Parse(directory string) (*modfile.File, error)

Parse reads "go.mod" file from the given directory if it exists.

func ProjectNameFromModuleName

func ProjectNameFromModuleName(moduleName string) string

ProjectNameFromModuleName extract project name from a module name

Types

This section is empty.

Jump to

Keyboard shortcuts

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