Copyright 2021 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
package fetch
import (
)
LatestModuleVersions uses the proxy to get information about the latest versions of modulePath. It returns a LatestModuleVersions whose RawVersion and CookedVersion is obtained from the proxy @v/list and @latest endpoints. The cooked version is computed by choosing the latest version after removing versions that are retracted in the go.mod file of the raw version. The GoodVersion of LatestModuleVersions is not set. It should be determined when inserting into a data source, since it depends on the contents of the data source. The hasGoMod function that is passed in should check if version v of the module has a go.mod file, using a source other than the proxy (e.g. a database). If it doesn't have enough information to decide, it should return an error that wraps derrors.NotFound. If a module has no tagged versions and hasn't been accessed at a pseudo-version in a while, then the proxy's list endpoint will serve nothing and its @latest endpoint will return a 404/410. (Example: cloud.google.com/go/compute/metadata, which has a v0.0.0-20181107005212-dafb9c8d8707 that @latest does not return.) That is not a failure, but a valid state in which there is no version information for a module, even though particular pseudo-versions of the module might exist. In this case, LatestModuleVersions returns (nil, nil). As a special case, the "std" module's versions are fetched from the repo (by calling stdlib.Versions). We assume stdlib versions are never retracted, and that there are no incompatible versions.
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.