this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/mod/modload: preserve custom struct in module when tidying requirements

This updates modfileFromRequirements to copy the custom struct from the
original modfile to the tidied one.

Fixes #3876

Closes #3877 as merged as of commit 43982180.

Signed-off-by: Stefan Nuxoll <stefan@nuxoll.me>
Change-Id: I3e1b57aeb9570aabc0da992f491a445998b80fcf
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1212931
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

authored by

Stefan Nuxoll and committed by
Roger Peppe
e0580148 ebf42e56

+21
+20
internal/mod/modload/testdata/tidy/preserve-custom.txtar
··· 1 + -- cue.mod/module.cue -- 2 + module: "cue.example" 3 + language: { 4 + version: "v0.12.0" 5 + } 6 + custom: { 7 + "example.com/mycoolmodule": { 8 + test: "data" 9 + } 10 + } 11 + -- want -- 12 + module: "cue.example" 13 + language: { 14 + version: "v0.12.0" 15 + } 16 + custom: { 17 + "example.com/mycoolmodule": { 18 + test: "data" 19 + } 20 + }
+1
internal/mod/modload/tidy.go
··· 156 156 Language: old.Language, 157 157 Deps: make(map[string]*modfile.Dep), 158 158 Source: old.Source, 159 + Custom: old.Custom, 159 160 } 160 161 defaults := rs.DefaultMajorVersions() 161 162 for _, v := range rs.RootModules() {