Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitPathVersion ¶
SplitPathVersion splits a path@version into path & version
func WriteFS ¶
Write modules directly into the cache directory in an acceptable format so that Go thinks these files are cached and doesn't try reading them from the network.
This implementation is the minimal format needed to get `go mod tidy` to think the files are cached. This shouldn't be used outside of testing contexts.
Based on: https://github.com/golang/go/blob/master/src/cmd/go/internal/modfetch/fetch.go
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) ResolveDirectory ¶
ResolveDirectory returns the directory to which m should have been downloaded. An error will be returned if the module path or version cannot be escaped. An error satisfying errors.Is(err, os.ErrNotExist) will be returned along with the directory if the directory does not exist or if the directory is not completely populated.
func (*Cache) Write ¶
Write modules directly into the cache directory in an acceptable format so that Go thinks these files are cached and doesn't try reading them from the network.
This implementation is the minimal format needed to get `go mod tidy` to think the files are cached. This shouldn't be used outside of testing contexts.
Based on: https://github.com/golang/go/blob/master/src/cmd/go/internal/modfetch/fetch.go