type query … type pathSet … // errSet returns a pathSet containing the given error. func errSet(err error) pathSet { … } // newQuery returns a new query parsed from the raw argument, // which must be either path or path@version. func newQuery(raw string) (*query, error) { … } // validate reports a non-nil error if q is not sensible and well-formed. func (q *query) validate() error { … } // String returns the original argument from which q was parsed. func (q *query) String() string { … } // ResolvedString returns a string describing m as a resolved match for q. func (q *query) ResolvedString(m module.Version) string { … } // isWildcard reports whether q is a pattern that can match multiple paths. func (q *query) isWildcard() bool { … } // matchesPath reports whether the given path matches q.pattern. func (q *query) matchesPath(path string) bool { … } // canMatchInModule reports whether the given module path can potentially // contain q.pattern. func (q *query) canMatchInModule(mPath string) bool { … } // pathOnce invokes f to generate the pathSet for the given path, // if one is still needed. // // Note that, unlike sync.Once, pathOnce does not guarantee that a concurrent // call to f for the given path has completed on return. // // pathOnce is safe for concurrent use by multiple goroutines, but note that // multiple concurrent calls will result in the sets being added in // nondeterministic order. func (q *query) pathOnce(path string, f func() pathSet) { … } // reportError logs err concisely using base.Errorf. func reportError(q *query, err error) { … } func reportConflict(pq *query, m module.Version, conflict versionReason) { … } type conflictError … func (e *conflictError) Error() string { … } func versionOkForMainModule(version string) bool { … }