Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBug is returned when the error is probably a bug. ErrBug = errors.New("probably a bug") // ErrInvalidGowork is returned when the go.work is invalid. ErrInvalidGowork = errors.New("invalid go.work") // ErrInvalidGomod is returned when the go.mod is invalid. ErrInvalidGomod = errors.New("invalid go.mod") )
Functions ¶
This section is empty.
Types ¶
type Environment ¶
Environment is used to get environment variables.
type FileSystem ¶
FileSystem is used to read files from the file system in a testable way.
type Module ¶
type Module struct { // Name is a module name. Name string // Path is a module file path. Path string }
Module represents a Go module.
func Current ¶
func Current(filesystem FileSystem, env Environment) (*Module, error)
Current returns the current Go module.
func List ¶
func List(filesystem FileSystem, env Environment) ([]Module, error)
List returns the list of modules in the current Go workspace.
type RealSystem ¶
type RealSystem struct{}
RealSystem is the real, live OS implementation.
func (RealSystem) Abs ¶
func (s RealSystem) Abs(filepath string) string
func (RealSystem) Cwd ¶
func (s RealSystem) Cwd() (string, error)
func (RealSystem) Get ¶
func (s RealSystem) Get(name string) string
Click to show internal directories.
Click to hide internal directories.