mod

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package mod provides functionality around modules

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	Path      string       `json:",omitempty"` // module path
	Version   string       `json:",omitempty"` // module version
	Versions  []string     `json:",omitempty"` // available module versions
	Replace   *Module      `json:",omitempty"` // replaced by this module
	Time      *time.Time   `json:",omitempty"` // time version was created
	Update    *Module      `json:",omitempty"` // available update (with -u)
	Main      bool         `json:",omitempty"` // is this the main module?
	Indirect  bool         `json:",omitempty"` // module is only indirectly needed by main module
	Dir       string       `json:",omitempty"` // directory holding local copy of files, if any
	GoMod     string       `json:",omitempty"` // path to go.mod file describing module, if any
	Error     *ModuleError `json:",omitempty"` // error loading module
	GoVersion string       `json:",omitempty"` // go version used in module
}

Module holds information about a specific module listed by go list

func FilterModules

func FilterModules(modules []Module, hasUpdate, isDirect bool) []Module

FilterModules filters the list of modules provided by the go list command

func (*Module) CurrentVersion

func (m *Module) CurrentVersion() string

CurrentVersion returns the current version of the module taking into consideration the any Replace settings

func (*Module) HasUpdate

func (m *Module) HasUpdate() bool

HasUpdate checks if the module has a new version

func (*Module) InvalidTimestamp

func (m *Module) InvalidTimestamp() bool

InvalidTimestamp checks if the version reported as update by the go list command is actually newer that current version

func (*Module) NewVersion

func (m *Module) NewVersion() string

NewVersion returns the version of the update taking into consideration the any Replace settings

type ModuleError

type ModuleError struct {
	Err string // error text
}

ModuleError represents the error when a module cannot be loaded

Jump to

Keyboard shortcuts

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