Documentation ¶
Index ¶
- func CompareSum(src, dst *Sum) (errs []error)
- func SyncRequire(src, dst *Mod) (errs []error)
- type Mod
- func (m *Mod) DelRequire(importPath string) (found bool)
- func (m *Mod) GetRequire(importPath string) (require ModRequire, found bool)
- func (m *Mod) Replaces() (r []ModReplace)
- func (m *Mod) Requires() (r []ModRequire)
- func (m *Mod) SetRequire(importPath string, require ModRequire)
- func (m *Mod) String() string
- type ModReplace
- type ModRequire
- type Sum
- type SumLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareSum ¶
CompareSum verifies each go.sum hash in the destination matches the source's.
func SyncRequire ¶
SyncRequire overwrites each go.mod `require (...)` version in the destination with the source's.
Types ¶
type Mod ¶
type Mod struct { // Path is from the `module <path>` directive. Path string // Go is the `go` directive value. Go string // contains filtered or unexported fields }
func NewModFromFile ¶
func (*Mod) DelRequire ¶
func (*Mod) GetRequire ¶
func (m *Mod) GetRequire(importPath string) (require ModRequire, found bool)
func (*Mod) Replaces ¶
func (m *Mod) Replaces() (r []ModReplace)
Replace returns all `replace` directives in the order they were read.
func (*Mod) Requires ¶
func (m *Mod) Requires() (r []ModRequire)
Require returns all `require (...)` directives in the order they were read.
func (*Mod) SetRequire ¶
func (m *Mod) SetRequire(importPath string, require ModRequire)
SetRequire overwrites the identified require's fields with new values.
type ModReplace ¶
type ModReplace struct { // Old is the replaced import path. Old string // New is the replacement path. New string // Version holds the optional version selection. Version string }
ModReplace defines one `replace` directive.
func (ModReplace) String ¶
func (r ModReplace) String() string
type ModRequire ¶
type ModRequire struct { // Comment is the substring found after the version. If a comment was present, it contains // the leading space. Comment string // Path is an import path. Path string // Version holds the version substring. Version string }
ModRequire defines one line of the `require (...)` directive block.
func (ModRequire) String ¶
func (r ModRequire) String() string
Click to show internal directories.
Click to hide internal directories.