Documentation
¶
Index ¶
- func Run(ctx context.Context, command string, modfile string, stdout io.Writer, ...) error
- func RunEdit(ctx context.Context, modfile string, edits ...Edit) error
- func RunGet(ctx context.Context, modfile string, modSpecs ...string) error
- type Edit
- type File
- type Replace
- type Require
- type Toolchain
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(ctx context.Context, command string, modfile string, stdout io.Writer, args ...string) error
Run executes the `go mod <command> <args...>` subcommand with the provided arguments on the designated `go.mod` file, sending standard output to the provided writer.
Types ¶
type Edit ¶
type Edit interface {
// contains filtered or unexported methods
}
Edit represents an edition that can be made to a `go.mod` file via `go mod edit`.
type File ¶
type File struct {
// Go is the value of the `go` directive.
Go Version
// Toolchain is the value of the `toolchain` directive, if present.
Toolchain Toolchain
// Require is a list of all `require` directives' contents.
Require []Require
}
File represents some selected entries from the content of a `go.mod` file.
type Replace ¶
type Replace struct {
// OldPath is the path of the module being replaced.
OldPath string
// OldVersion is the version of the module being replaced, if any.
OldVersion string
// NewPath is the path of the replacement module.
NewPath string
// NewVersion is the version of the replacement module, if any.
NewVersion string
}
Replace represents the target of a `replace` directive entry.
Click to show internal directories.
Click to hide internal directories.