Documentation
¶
Overview ¶
Package gomod implements a notice.Collector for direct dependencies declared in go.mod.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdRunner ¶
CmdRunner runs an external command and returns stdout. Tests inject a fake to keep `go mod download` out of the loop.
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector enumerates direct (non-indirect) dependencies in go.mod and builds a NOTICE entry for each by consulting the module cache via `go mod download -json`.
type FileSystem ¶
FileSystem is the small slice of os we depend on. Tests inject a fake to keep the host filesystem out of the loop where it would otherwise consult the real Go module cache.
type Option ¶
type Option func(*Collector)
Option configures a Collector.
func WithFS ¶
func WithFS(f FileSystem) Option
WithFS injects a FileSystem. Defaults to the host filesystem.
func WithRunner ¶
WithRunner injects a CmdRunner. Defaults to invoking the real `go` binary.