Documentation
¶
Overview ¶
Package lock reads and writes platformgo.lock: what platformgo has actually applied to a project.
platformgo.yaml says what the project wants; the lock says what it got. The difference between the two is what lets apply remove the files of a module that is no longer declared, so taking a module out never needs manual cleanup.
Index ¶
Constants ¶
View Source
const FileName = "platformgo.lock"
FileName is the lock file in the project root.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Diff ¶
type Diff struct {
AddedModules []string
RemovedModules []string
StaleFiles []string // generated before and no longer generated
StaleTools []string // added before and no longer needed
}
Diff is what changes between two locks.
type Lock ¶
type Lock struct {
Platform string `yaml:"platform,omitempty"`
Modules []string `yaml:"modules"` // enabled modules
Generated []string `yaml:"generated"` // files owned by generation
Tools []string `yaml:"tools"` // tools added to go.mod by platformgo
}
Lock is the content of platformgo.lock.
Platform is the version that applied the project last. go.mod says which version the project requires; this says which one has already rewritten it, so the next version knows which codemods are still to run.
Click to show internal directories.
Click to hide internal directories.