69// from newer pre-release or development versions.
70//
71▶// The allowed function (which may be nil) is used to filter out unsuitable
72// versions (see AllowedFunc documentation for details). If the query refers to
73// a specific revision (for example, "master"; see IsRevisionQuery), and the
· · ·
72▶// versions (see AllowedFunc documentation for details). If the query refers to
73// a specific revision (for example, "master"; see IsRevisionQuery), and the
74// revision is disallowed by allowed, Query returns the error. If the query
· · ·
76// acts as if versions disallowed by allowed do not exist.
77//
78▶// If path is the path of the main module and the query is "latest",
79// Query returns Target.Version as the version.
80//
· · ·
81// Query often returns a non-nil *RevInfo with a non-nil error,
82// to provide an info.Origin that can allow the error to be cached.
83▶func Query(ld *Loader, ctx context.Context, path, query, current string, allowed AllowedFunc) (*modfetch.RevInfo, error) {
84 ctx, span := trace.StartSpan(ctx, "modload.Query "+path)
85 defer span.Done()
· · ·
90// queryReuse is like Query but also takes a map of module info that can be reused
91// if the validation criteria in Origin are met.
92▶func queryReuse(ld *Loader, ctx context.Context, path, query, current string, allowed AllowedFunc, reuse map[module.Version]*modinfo.ModulePublic) (*modfetch.RevInfo, error) {
93 var info *modfetch.RevInfo
94 err := modfetch.TryProxies(func(proxy string) (err error) {
+ 141 more matches in this file