Documentation ¶
Overview ¶
Package mod exposes methods to parse a go.mod file.
Index ¶
Constants ¶
View Source
const Filename = "go.mod"
Filename is the name of Go module file.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a go.mod file.
func (*File) Dependencies ¶
Dependencies implements the Mod interface.
func (*File) UpdateReplace ¶
UpdateReplace implements the Mod interface.
func (*File) UpdateRequire ¶
UpdateRequire implements the Mod interface.
type Mod ¶
type Mod interface { // Module returns the name of the module. Module() string // Name returns the relative path of the go.mod Name() string // Dependencies returns the dependencies of the module. Dependencies() []Module // UpdateRequire adds an update of this required module path to the given version. UpdateRequire(path, version string) error // UpdateReplace adds an update on the replacement of this module path to the given version. UpdateReplace(oldPath, newVersion string) error // Format applies any requested updates to the file content. Format() ([]byte, error) }
Mod represents a Go module file.
Click to show internal directories.
Click to hide internal directories.