// Replacement returns the replacement for mod, if any, from go.mod. // If there is no replacement for mod, Replacement returns // a module.Version with Path == "". public static module.Version Replacement(module.Version mod) { if (index != null) { { var r__prev2 = r; var(r, ok) = index.replace[mod]; if (ok) { return(r); } r = r__prev2; } { var r__prev2 = r; (r, ok) = index.replace[new module.Version(Path: mod.Path)]; if (ok) { return(r); } r = r__prev2; } } return(new module.Version()); }
public ImportMissingError(@string Path = default, module.Version Module = default, error QueryErr = default, @string newMissingVersion = default) { this.Path = Path; this.Module = Module; this.QueryErr = QueryErr; this.newMissingVersion = newMissingVersion; }
public PackageNotInModuleError(module.Version Mod = default, module.Version Replacement = default, @string Query = default, @string Pattern = default) { this.Mod = Mod; this.Replacement = Replacement; this.Query = Query; this.Pattern = Pattern; }
public modGraphNode(module.Version m = default, slice <module.Version> required = default, module.Version upgrade = default, error err = default) { this.m = m; this.required = required; this.upgrade = upgrade; this.err = err; }
public fileJSON(module.Version Module = default, @string Go = default, slice <requireJSON> Require = default, slice <module.Version> Exclude = default, slice <replaceJSON> Replace = default) { this.Module = Module; this.Go = Go; this.Require = Require; this.Exclude = Exclude; this.Replace = Replace; }
public loadPkg(@string path = default, module.Version mod = default, @string dir = default, slice <ptr <loadPkg> > imports = default, error err = default, ref ptr <loadPkg> stack = default, ref ptr <loadPkg> test = default, ref ptr <loadPkg> testOf = default, slice <@string> testImports = default) { this.path = path; this.mod = mod; this.dir = dir; this.imports = imports; this.err = err; this.stack = stack; this.test = test; this.testOf = testOf; this.testImports = testImports; }
// readVendorList reads the list of vendored modules from vendor/modules.txt. private static void readVendorList() { vendorOnce.Do(() => { vendorList = null; vendorPkgModule = make_map <@string, module.Version>(); vendorVersion = make_map <@string, @string>(); vendorMeta = make_map <module.Version, vendorMetadata>(); var(data, err) = ioutil.ReadFile(filepath.Join(ModRoot(), "vendor/modules.txt")); if (err != null) { if (!errors.Is(err, os.ErrNotExist)) { @base.Fatalf("go: %s", err); } return; } module.Version mod = default; foreach (var(_, line) in strings.Split(string(data), "\n")) { if (strings.HasPrefix(line, "# ")) { var f = strings.Fields(line); if (len(f) < 3L) { continue; } if (semver.IsValid(f[2L])) { // A module, but we don't yet know whether it is in the build list or // only included to indicate a replacement. mod = new module.Version(Path: f[1], Version: f[2]); f = f[3L..]; }
public modFileIndex(slice <byte> data = default, bool dataNeedsFix = default, module.Version module = default, @string goVersion = default, map <module.Version, requireMeta> require = default, map <module.Version, module.Version> replace = default, map <module.Version, bool> exclude = default) { this.data = data; this.dataNeedsFix = dataNeedsFix; this.module = module; this.goVersion = goVersion; this.require = require; this.replace = replace; this.exclude = exclude; }
// lookupSumDB returns the Go checksum database's go.sum lines for the given module, // along with the name of the database. private static (@string, slice <@string>, error) lookupSumDB(module.Version mod) { @string dbname = default; slice <@string> lines = default; error err = default !;
public vendorMetadata(bool Explicit = default, module.Version Replacement = default) { this.Explicit = Explicit; this.Replacement = Replacement; }
// useSumDB reports whether to use the Go checksum database for the given module. private static bool useSumDB(module.Version mod) { return(cfg.GOSUMDB != "off" && !get.Insecure && !str.GlobsMatchPath(cfg.GONOSUMDB, mod.Path)); }
private static bool useSumDB(module.Version mod) { return(false); }
public lostUpgradeReqs(mvs.Reqs Reqs = default, module.Version lost = default) { this.Reqs = Reqs; this.lost = lost; }
private delegate(module.Version, error) PreviousByVal(T value, module.Version m);
public Exclude(module.Version Mod = default, ref ptr <Line> Syntax = default) { this.Mod = Mod; this.Syntax = Syntax; }
private delegate(module.Version, error) UpgradeByVal(T value, module.Version m);
private delegate(module.Version, error) UpgradeByRef(ref T value, module.Version m);
private delegate(module.Version, error) RequiredByRef(ref T value, module.Version m);
private delegate(module.Version, error) RequiredByVal(T value, module.Version m);
public @override(module.Version target = default, slice <module.Version> list = default, Reqs Reqs = default) { this.target = target; this.list = list; this.Reqs = Reqs; }
public Require(module.Version Mod = default, bool Indirect = default, ref ptr <Line> Syntax = default) { this.Mod = Mod; this.Indirect = Indirect; this.Syntax = Syntax; }
public querySpec(@string path = default, @string vers = default, bool forceModulePath = default, module.Version prevM = default) { this.path = path; this.vers = vers; this.forceModulePath = forceModulePath; this.prevM = prevM; }
// Allowed reports whether module m is allowed (not excluded) by the main module's go.mod. public static bool Allowed(module.Version m) { return(index == null || !index.exclude[m]); }
// Download downloads the specific module version to the // local download cache and returns the name of the directory // corresponding to the root of the module's file tree. public static (@string, error) Download(module.Version mod) { @string dir = default; error err = default!;
private static (@string, slice <@string>, error) lookupSumDB(module.Version mod) => func((_, panic, __) =>
public Replace(module.Version Old = default, module.Version New = default, ref ptr <Line> Syntax = default) { this.Old = Old; this.New = New; this.Syntax = Syntax; }
private delegate(module.Version, error) PreviousByRef(ref T value, module.Version m);
public QueryResult(module.Version Mod = default, ref ptr <modfetch.RevInfo> Rev = default, slice <@string> Packages = default) { this.Mod = Mod; this.Rev = Rev; this.Packages = Packages; }
public buildListErrorElem(module.Version m = default, @string nextReason = default) { this.m = m; this.nextReason = nextReason; }
public (module.Version, error) Previous(module.Version m) => s_PreviousByRef?.Invoke(ref this, m) ?? s_PreviousByVal?.Invoke(this, m) ?? Reqs?.Previous(m) ?? throw new PanicException(RuntimeErrorPanic.NilPointerDereference);