diff --git a/FAQ.md b/FAQ.md index 983ca84b7e..c6c5956212 100644 --- a/FAQ.md +++ b/FAQ.md @@ -7,7 +7,7 @@ Please contribute to the FAQ! Found an explanation in an issue or pull request h Summarize the question and quote the reply, linking back to the original comment. * [What is the difference between Gopkg.toml (the "manifest") and Gopkg.lock (the "lock")?](#what-is-the-difference-between-gopkgtoml-the-manifest-and-gopkglock-the-lock) -* [When should I use dependencies, overrides or required in the manifest?](#when-should-i-use-dependencies-overrides-required-or-ignored-in-the-manifest) +* [When should I use `constraint`, `override` `required`, or `ignored` in the Gopkg.toml?](#when-should-i-use-constraint-override-required-or-ignored-in-gopkgtoml) * [What is a direct or transitive dependency?](#what-is-a-direct-or-transitive-dependency) * [Should I commit my vendor directory?](#should-i-commit-my-vendor-directory) * [Why is it `dep ensure` instead of `dep install`?](#why-is-it-dep-ensure-instead-of-dep-install) @@ -27,10 +27,10 @@ Summarize the question and quote the reply, linking back to the original comment > This flexibility is important because it allows us to provide easy commands (e.g. `dep ensure -update`) that can manage an update process for you, within the constraints you specify, AND because it allows your project, when imported by someone else, to collaboratively specify the constraints for your own dependencies. -[@sdboyer in #281](https://github.com/golang/dep/issues/281#issuecomment-284118314) -## When should I use dependencies, overrides, required, or ignored in the manifest? +## When should I use `constraint`, `override`, `required`, or `ignored` in `Gopkg.toml`? -* Use `dependencies` to constrain a [direct dependency](#what-is-a-direct-or-transitive-dependency) to a specific branch, version range, revision, or specify an alternate source such as a fork. -* Use `overrides` to constrain a [transitive dependency](#what-is-a-direct-or-transitive-dependency). See [How do I constrain a transitive dependency's version?](#how-do-i-constrain-a-transitive-dependencys-version) for more details on how overrides differ from dependencies. Overrides should be used cautiously, sparingly, and temporarily. +* Use `constraint` to constrain a [direct dependency](#what-is-a-direct-or-transitive-dependency) to a specific branch, version range, revision, or specify an alternate source such as a fork. +* Use `override` to constrain a [transitive dependency](#what-is-a-direct-or-transitive-dependency). See [How do I constrain a transitive dependency's version?](#how-do-i-constrain-a-transitive-dependencys-version) for more details on how overrides differ from dependencies. Overrides should be used cautiously, sparingly, and temporarily. * Use `required` to explicitly add a dependency that is not imported directly or transitively, for example a development package used for code generation. * Use `ignored` to ignore a package and any of that package's unique dependencies. diff --git a/Gopkg.lock b/Gopkg.lock index 92186ad471..d858806f0c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,4 +1,5 @@ -memo = "932b7b1663f6eecccb1fada1d3670ae24cd8aa7c8b61e3b224edfefebe25954e" +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + [[projects]] branch = "2.x" @@ -41,3 +42,10 @@ memo = "932b7b1663f6eecccb1fada1d3670ae24cd8aa7c8b61e3b224edfefebe25954e" name = "github.com/sdboyer/constext" packages = ["."] revision = "836a144573533ea4da4e6929c235fd348aed1c80" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "04a69739bd134208497dbd584b8b6dbf9bbdc41337e9c1c81e24d9f1502d5153" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 26c6b5de3f..b1d62c9671 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,17 +1,15 @@ -required = ["github.com/Masterminds/semver"] - -[[dependencies]] +[[constraint]] branch = "2.x" name = "github.com/Masterminds/semver" -[[dependencies]] +[[constraint]] name = "github.com/Masterminds/vcs" - version = "^1.11.0" + version = "1.11.0" -[[dependencies]] +[[constraint]] branch = "master" name = "github.com/pelletier/go-toml" -[[dependencies]] +[[constraint]] name = "github.com/pkg/errors" - version = ">=0.8.0, <1.0.0" + version = "0.8.0" diff --git a/cmd/dep/ensure.go b/cmd/dep/ensure.go index 5a28839430..3eabb3482e 100644 --- a/cmd/dep/ensure.go +++ b/cmd/dep/ensure.go @@ -163,7 +163,7 @@ func (cmd *ensureCommand) Run(ctx *dep.Ctx, args []string) error { writeV = dep.VendorAlways } - newLock := dep.LockFromInterface(solution) + newLock := dep.LockFromSolution(solution) sw, err := dep.NewSafeWriter(nil, p.Lock, newLock, writeV) if err != nil { return err @@ -205,14 +205,14 @@ func applyEnsureArgs(logger *log.Logger, args []string, overrides stringSlice, p // // TODO(sdboyer): for this case - or just in general - do we want to // add project args to the requires list temporarily for this run? - if _, has := p.Manifest.Dependencies[pc.Ident.ProjectRoot]; !has { + if _, has := p.Manifest.Constraints[pc.Ident.ProjectRoot]; !has { logger.Printf("dep: No constraint or alternate source specified for %q, omitting from manifest\n", pc.Ident.ProjectRoot) } // If it's already in the manifest, no need to log continue } - p.Manifest.Dependencies[pc.Ident.ProjectRoot] = gps.ProjectProperties{ + p.Manifest.Constraints[pc.Ident.ProjectRoot] = gps.ProjectProperties{ Source: pc.Ident.Source, Constraint: pc.Constraint, } @@ -329,7 +329,7 @@ func getProjectConstraint(arg string, sm gps.SourceManager) (gps.ProjectConstrai // semver, a revision, or as a fallback, a plain tag func deduceConstraint(s string) gps.Constraint { // always semver if we can - c, err := gps.NewSemverConstraint(s) + c, err := gps.NewSemverConstraintIC(s) if err == nil { return c } diff --git a/cmd/dep/ensure_test.go b/cmd/dep/ensure_test.go index 5d1a4ee232..927cac2492 100644 --- a/cmd/dep/ensure_test.go +++ b/cmd/dep/ensure_test.go @@ -5,6 +5,7 @@ package main import ( + "reflect" "testing" "github.com/golang/dep/internal/gps" @@ -13,7 +14,7 @@ import ( func TestDeduceConstraint(t *testing.T) { t.Parallel() - sv, err := gps.NewSemverConstraint("v1.2.3") + sv, err := gps.NewSemverConstraintIC("v1.2.3") if err != nil { t.Fatal(err) } @@ -31,10 +32,16 @@ func TestDeduceConstraint(t *testing.T) { "20120425195858-psty8c35ve2oej8t": gps.NewVersion("20120425195858-psty8c35ve2oej8t"), } - for str, expected := range constraints { - c := deduceConstraint(str) - if c != expected { - t.Fatalf("expected: %#v, got %#v for %s", expected, c, str) + for str, want := range constraints { + got := deduceConstraint(str) + + wantT := reflect.TypeOf(want) + gotT := reflect.TypeOf(got) + if wantT != gotT { + t.Errorf("expected type: %s, got %s, for input %s", wantT, gotT, str) + } + if got.String() != want.String() { + t.Errorf("expected value: %s, got %s for input %s", want, got, str) } } } diff --git a/cmd/dep/init.go b/cmd/dep/init.go index 189ad039c0..6e3bce7fb0 100644 --- a/cmd/dep/init.go +++ b/cmd/dep/init.go @@ -122,7 +122,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error { return err } m := &dep.Manifest{ - Dependencies: pd.constraints, + Constraints: pd.constraints, } // Make an initial lock from what knowledge we've collected about the @@ -185,7 +185,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error { handleAllTheFailuresOfTheWorld(err) return err } - l = dep.LockFromInterface(soln) + l = dep.LockFromSolution(soln) // Iterate through the new projects in solved lock and add them to manifest // if direct deps @@ -201,7 +201,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error { if newProject { // If it's in notondisk, add to manifest, these are direct dependencies. if _, ok := pd.notondisk[pr]; ok { - m.Dependencies[pr] = getProjectPropertiesFromVersion(x.Version()) + m.Constraints[pr] = getProjectPropertiesFromVersion(x.Version()) } } } @@ -213,7 +213,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error { return errors.Wrap(err, "prepare solver") } - l.Memo = s.HashInputs() + l.SolveMeta.Memo = s.HashInputs() // Pass timestamp (yyyyMMddHHmmss format) as suffix to backup name. vendorbak, err := dep.BackupVendor(vpath, time.Now().Format("20060102150405")) @@ -319,8 +319,7 @@ func getProjectPropertiesFromVersion(v gps.Version) gps.ProjectProperties { case gps.IsBranch, gps.IsVersion: pp.Constraint = v case gps.IsSemver: - // TODO: remove "^" when https://github.com/golang/dep/issues/225 is ready. - c, err := gps.NewSemverConstraint("^" + v.String()) + c, err := gps.NewSemverConstraintIC(v.String()) if err != nil { panic(err) } diff --git a/cmd/dep/init_test.go b/cmd/dep/init_test.go index 37b6cfdf18..0c177de296 100644 --- a/cmd/dep/init_test.go +++ b/cmd/dep/init_test.go @@ -27,7 +27,7 @@ func TestContains(t *testing.T) { func TestGetProjectPropertiesFromVersion(t *testing.T) { t.Parallel() - wantSemver, _ := gps.NewSemverConstraint("^v1.0.0") + wantSemver, _ := gps.NewSemverConstraintIC("v1.0.0") cases := []struct { version, want gps.Constraint }{ diff --git a/cmd/dep/prune.go b/cmd/dep/prune.go index cd59655160..fa2e6a7b91 100644 --- a/cmd/dep/prune.go +++ b/cmd/dep/prune.go @@ -68,7 +68,7 @@ func (cmd *pruneCommand) Run(ctx *dep.Ctx, args []string) error { return errors.Wrap(err, "could not set up solver for input hashing") } - if !bytes.Equal(s.HashInputs(), p.Lock.Memo) { + if !bytes.Equal(s.HashInputs(), p.Lock.SolveMeta.Memo) { return fmt.Errorf("lock hash doesn't match") } diff --git a/cmd/dep/remove.go b/cmd/dep/remove.go index 6cbe312b4b..294bca5df9 100644 --- a/cmd/dep/remove.go +++ b/cmd/dep/remove.go @@ -97,9 +97,9 @@ func (cmd *removeCommand) Run(ctx *dep.Ctx, args []string) error { } var rm []gps.ProjectRoot - for pr := range p.Manifest.Dependencies { + for pr := range p.Manifest.Constraints { if _, has := otherroots[pr]; !has { - delete(p.Manifest.Dependencies, pr) + delete(p.Manifest.Constraints, pr) rm = append(rm, pr) } } @@ -145,7 +145,7 @@ func (cmd *removeCommand) Run(ctx *dep.Ctx, args []string) error { } } - if _, indeps := p.Manifest.Dependencies[gps.ProjectRoot(arg)]; !indeps { + if _, indeps := p.Manifest.Constraints[gps.ProjectRoot(arg)]; !indeps { return errors.Errorf("%q is not present in the manifest, cannot remove it", arg) } @@ -156,7 +156,7 @@ func (cmd *removeCommand) Run(ctx *dep.Ctx, args []string) error { return errors.Errorf("not removing %q because it is imported by:\n\t%s (pass -force to override)", arg, strings.Join(pkgimport, "\n\t")) } - delete(p.Manifest.Dependencies, gps.ProjectRoot(arg)) + delete(p.Manifest.Constraints, gps.ProjectRoot(arg)) } } @@ -177,7 +177,7 @@ func (cmd *removeCommand) Run(ctx *dep.Ctx, args []string) error { return err } - newLock := dep.LockFromInterface(soln) + newLock := dep.LockFromSolution(soln) sw, err := dep.NewSafeWriter(nil, p.Lock, newLock, dep.VendorOnChanged) if err != nil { diff --git a/cmd/dep/status.go b/cmd/dep/status.go index 3dfedc35fc..8dce359917 100644 --- a/cmd/dep/status.go +++ b/cmd/dep/status.go @@ -278,7 +278,7 @@ func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.So slp := p.Lock.Projects() sort.Sort(dep.SortedLockedProjects(slp)) - if bytes.Equal(s.HashInputs(), p.Lock.Memo) { + if bytes.Equal(s.HashInputs(), p.Lock.SolveMeta.Memo) { // If these are equal, we're guaranteed that the lock is a transitively // complete picture of all deps. That eliminates the need for at least // some checks. @@ -331,7 +331,7 @@ func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.So // Only if we have a non-rev and non-plain version do/can we display // anything wrt the version's updateability. if bs.Version != nil && bs.Version.Type() != gps.IsVersion { - c, has := p.Manifest.Dependencies[proj.Ident().ProjectRoot] + c, has := p.Manifest.Constraints[proj.Ident().ProjectRoot] if !has { c.Constraint = gps.Any() } diff --git a/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.lock index 481ac452f7..c7f497e7a1 100644 --- a/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.lock @@ -1,9 +1,15 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c" [[projects]] name = "github.com/sdboyer/deptest" packages = ["."] revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf" version = "v1.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.toml index 26987273ec..e443a4a22d 100644 --- a/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.toml @@ -12,9 +12,10 @@ ## or in a dependency. # ignored = ["github.com/user/project/badpkg"] -## Dependencies define constraints on dependent projects. They are respected by +## Constraints are rules for how directly imported projects +## may be incorporated into the depgraph. They are respected by ## dep whether coming from the Gopkg.toml of the current project or a dependency. -# [[dependencies]] +# [[constraint]] ## Required: the root import path of the project being constrained. # name = "github.com/user/project" # @@ -27,12 +28,12 @@ ## Optional: an alternate location (URL or import path) for the project's source. # source = "https://github.com/myfork/package.git" -## Overrides have the same structure as [[dependencies]], but supercede all -## [[dependencies]] declarations from all projects. Only the current project's -## [[overrides]] are applied. +## Override have the same structure as [[constraint]], but supercede all +## [[constraint]] declarations from all projects. Only the current project's +## [[override]] is applied. ## -## Overrides are a sledgehammer. Use them only as a last resort. -# [[overrides]] +## Override is a sledgehammer. Use them only as a last resort. +# [[override]] ## Required: the root import path of the project being constrained. # name = "github.com/user/project" # @@ -51,6 +52,6 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" - version = "^1.0.0" + version = "1.0.0" diff --git a/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.lock index 64f416a865..a783451f80 100644 --- a/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.lock @@ -1,9 +1,15 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "e7725ea56516a42a641aaaf5d48754258d9f3c59949cb8a0e8a21b1ab6e07179" [[projects]] name = "github.com/sdboyer/deptest" packages = ["."] revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf" version = "v1.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "e7725ea56516a42a641aaaf5d48754258d9f3c59949cb8a0e8a21b1ab6e07179" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.toml index d327c51ade..532da96a0d 100644 --- a/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "~0.8.0" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/ensure/empty/case2/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/empty/case2/initial/Gopkg.toml index d327c51ade..532da96a0d 100644 --- a/cmd/dep/testdata/harness_tests/ensure/empty/case2/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/empty/case2/initial/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "~0.8.0" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.lock index dfdbdb26ce..d2153e3747 100644 --- a/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.lock @@ -1,9 +1,15 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "e5c16e09ed6f0a1a2b3cf472c34b7fd50861dd070e81d5e623f72e8173f0c065" [[projects]] branch = "master" name = "github.com/sdboyer/deptest" packages = ["."] revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "e5c16e09ed6f0a1a2b3cf472c34b7fd50861dd070e81d5e623f72e8173f0c065" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.toml index dd0150055a..d77e367c70 100644 --- a/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.toml @@ -1,5 +1,5 @@ ignored = ["github.com/sdboyer/deptestdos"] -[[dependencies]] +[[constraint]] branch = "master" name = "github.com/sdboyer/deptest" diff --git a/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/Gopkg.toml index dd0150055a..d77e367c70 100644 --- a/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/Gopkg.toml @@ -1,5 +1,5 @@ ignored = ["github.com/sdboyer/deptestdos"] -[[dependencies]] +[[constraint]] branch = "master" name = "github.com/sdboyer/deptest" diff --git a/cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.lock index bbeef93747..ccd3cc61fc 100644 --- a/cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.lock @@ -1,9 +1,15 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "8bca9526e654e56e05d9075d1f33fa5b649bf6d58aa7d71ca39e7fbea8468e07" [[projects]] name = "github.com/sdboyer/deptest" packages = ["."] revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf" version = "v1.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "8bca9526e654e56e05d9075d1f33fa5b649bf6d58aa7d71ca39e7fbea8468e07" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.toml index 26987273ec..e443a4a22d 100644 --- a/cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.toml @@ -12,9 +12,10 @@ ## or in a dependency. # ignored = ["github.com/user/project/badpkg"] -## Dependencies define constraints on dependent projects. They are respected by +## Constraints are rules for how directly imported projects +## may be incorporated into the depgraph. They are respected by ## dep whether coming from the Gopkg.toml of the current project or a dependency. -# [[dependencies]] +# [[constraint]] ## Required: the root import path of the project being constrained. # name = "github.com/user/project" # @@ -27,12 +28,12 @@ ## Optional: an alternate location (URL or import path) for the project's source. # source = "https://github.com/myfork/package.git" -## Overrides have the same structure as [[dependencies]], but supercede all -## [[dependencies]] declarations from all projects. Only the current project's -## [[overrides]] are applied. +## Override have the same structure as [[constraint]], but supercede all +## [[constraint]] declarations from all projects. Only the current project's +## [[override]] is applied. ## -## Overrides are a sledgehammer. Use them only as a last resort. -# [[overrides]] +## Override is a sledgehammer. Use them only as a last resort. +# [[override]] ## Required: the root import path of the project being constrained. # name = "github.com/user/project" # @@ -51,6 +52,6 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" - version = "^1.0.0" + version = "1.0.0" diff --git a/cmd/dep/testdata/harness_tests/ensure/override/case1/testcase.json b/cmd/dep/testdata/harness_tests/ensure/override/case1/testcase.json index efbbc392f7..4f1ce1d26b 100644 --- a/cmd/dep/testdata/harness_tests/ensure/override/case1/testcase.json +++ b/cmd/dep/testdata/harness_tests/ensure/override/case1/testcase.json @@ -1,7 +1,7 @@ { "commands": [ ["init"], - ["ensure", "-override", "github.com/sdboyer/deptest@1.0.0"] + ["ensure", "-override", "github.com/sdboyer/deptest@=1.0.0"] ], "error-expected": "", "vendor-final": [ diff --git a/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/final/Gopkg.lock index d42f019dba..bef2d0092e 100644 --- a/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/final/Gopkg.lock @@ -1,3 +1,9 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.lock index c13a090cf8..1a7b1983f3 100644 --- a/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" [[projects]] name = "github.com/sdboyer/deptest" @@ -13,3 +12,10 @@ memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" packages = ["."] revision = "5c607206be5decd28e6263ffffdcee067266015e" version = "v2.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.toml index d327c51ade..532da96a0d 100644 --- a/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "~0.8.0" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/ensure/update/case1/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/update/case1/initial/Gopkg.toml index d327c51ade..532da96a0d 100644 --- a/cmd/dep/testdata/harness_tests/ensure/update/case1/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/update/case1/initial/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "~0.8.0" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/ensure/update/case2/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/update/case2/final/Gopkg.toml index d327c51ade..532da96a0d 100644 --- a/cmd/dep/testdata/harness_tests/ensure/update/case2/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/update/case2/final/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "~0.8.0" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/ensure/update/case2/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/ensure/update/case2/initial/Gopkg.toml index d327c51ade..532da96a0d 100644 --- a/cmd/dep/testdata/harness_tests/ensure/update/case2/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/ensure/update/case2/initial/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "~0.8.0" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.lock index e2783fc420..15b4e08bac 100644 --- a/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" [[projects]] name = "github.com/sdboyer/deptest" @@ -12,3 +11,10 @@ memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" name = "github.com/sdboyer/deptestdos" packages = ["."] revision = "a0196baa11ea047dd65037287451d36b861b00ea" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.toml index 6deaa21764..bbd0a05ba9 100644 --- a/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.toml @@ -1,4 +1,4 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" - version = "^0.8.0" + version = "0.8.0" diff --git a/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.lock index 3044c9e16e..608d5a8d97 100644 --- a/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "ced51326ad990b11098d8076d0f7d72d89eee1ba6e8dacc7bc73be05cddac438" [[projects]] name = "github.com/sdboyer/deptest" @@ -13,3 +12,10 @@ memo = "ced51326ad990b11098d8076d0f7d72d89eee1ba6e8dacc7bc73be05cddac438" packages = ["."] revision = "5c607206be5decd28e6263ffffdcee067266015e" version = "v2.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "ced51326ad990b11098d8076d0f7d72d89eee1ba6e8dacc7bc73be05cddac438" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.toml index 55921055ae..bea60bf6e6 100644 --- a/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.toml @@ -1,8 +1,8 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" - version = "^0.8.0" + version = "0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" - version = "^2.0.0" + version = "2.0.0" diff --git a/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.lock index f9f6c4c7f8..c4f18284da 100644 --- a/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "af9a783a5430dabcaaf44683c09e2b729e1c0d61f13bfdf6677c4fd0b41387ca" [[projects]] branch = "master" @@ -12,3 +11,10 @@ memo = "af9a783a5430dabcaaf44683c09e2b729e1c0d61f13bfdf6677c4fd0b41387ca" name = "github.com/sdboyer/deptestdos" packages = ["."] revision = "a0196baa11ea047dd65037287451d36b861b00ea" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "af9a783a5430dabcaaf44683c09e2b729e1c0d61f13bfdf6677c4fd0b41387ca" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.toml index 53a6aba272..a90dd2dadd 100644 --- a/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.toml @@ -1,4 +1,4 @@ -[[dependencies]] +[[constraint]] branch = "master" name = "github.com/sdboyer/deptest" diff --git a/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.lock index 481ac452f7..c7f497e7a1 100644 --- a/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.lock @@ -1,9 +1,15 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c" [[projects]] name = "github.com/sdboyer/deptest" packages = ["."] revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf" version = "v1.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.toml index d5f3e3c9d6..e242e02114 100644 --- a/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.toml @@ -1,4 +1,4 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" - version = "^1.0.0" + version = "1.0.0" diff --git a/cmd/dep/testdata/harness_tests/remove/force/case1/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/remove/force/case1/final/Gopkg.lock index c13a090cf8..1a7b1983f3 100644 --- a/cmd/dep/testdata/harness_tests/remove/force/case1/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/remove/force/case1/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" [[projects]] name = "github.com/sdboyer/deptest" @@ -13,3 +12,10 @@ memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" packages = ["."] revision = "5c607206be5decd28e6263ffffdcee067266015e" version = "v2.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/remove/force/case1/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/remove/force/case1/final/Gopkg.toml index 1fc0f2191c..01598ef4de 100644 --- a/cmd/dep/testdata/harness_tests/remove/force/case1/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/remove/force/case1/final/Gopkg.toml @@ -1,11 +1,11 @@ -[[dependencies]] +[[constraint]] name = "github.com/not/used" version = "2.0.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" revision = "a0196baa11ea047dd65037287451d36b861b00ea" diff --git a/cmd/dep/testdata/harness_tests/remove/force/case1/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/remove/force/case1/initial/Gopkg.toml index 1fc0f2191c..01598ef4de 100644 --- a/cmd/dep/testdata/harness_tests/remove/force/case1/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/remove/force/case1/initial/Gopkg.toml @@ -1,11 +1,11 @@ -[[dependencies]] +[[constraint]] name = "github.com/not/used" version = "2.0.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" revision = "a0196baa11ea047dd65037287451d36b861b00ea" diff --git a/cmd/dep/testdata/harness_tests/remove/specific/case1/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/remove/specific/case1/final/Gopkg.lock index f5520e258f..b4a3656bec 100644 --- a/cmd/dep/testdata/harness_tests/remove/specific/case1/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/remove/specific/case1/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "722f8e1427ab6d4dd1bc92376e4ce41ba6034a74e283a3fe4d65c7c838c7e0d2" [[projects]] name = "github.com/sdboyer/deptest" @@ -12,3 +11,10 @@ memo = "722f8e1427ab6d4dd1bc92376e4ce41ba6034a74e283a3fe4d65c7c838c7e0d2" name = "github.com/sdboyer/deptestdos" packages = ["."] revision = "a0196baa11ea047dd65037287451d36b861b00ea" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "722f8e1427ab6d4dd1bc92376e4ce41ba6034a74e283a3fe4d65c7c838c7e0d2" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/remove/specific/case1/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/remove/specific/case1/final/Gopkg.toml index a007e12ac5..35468b4798 100644 --- a/cmd/dep/testdata/harness_tests/remove/specific/case1/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/remove/specific/case1/final/Gopkg.toml @@ -1,11 +1,11 @@ -[[dependencies]] +[[constraint]] name = "github.com/not/used" version = "2.0.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" revision = "a0196baa11ea047dd65037287451d36b861b00ea" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/remove/specific/case1/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/remove/specific/case1/initial/Gopkg.toml index a007e12ac5..35468b4798 100644 --- a/cmd/dep/testdata/harness_tests/remove/specific/case1/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/remove/specific/case1/initial/Gopkg.toml @@ -1,11 +1,11 @@ -[[dependencies]] +[[constraint]] name = "github.com/not/used" version = "2.0.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" revision = "a0196baa11ea047dd65037287451d36b861b00ea" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/remove/specific/case2/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/remove/specific/case2/final/Gopkg.lock index 64f416a865..a783451f80 100644 --- a/cmd/dep/testdata/harness_tests/remove/specific/case2/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/remove/specific/case2/final/Gopkg.lock @@ -1,9 +1,15 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "e7725ea56516a42a641aaaf5d48754258d9f3c59949cb8a0e8a21b1ab6e07179" [[projects]] name = "github.com/sdboyer/deptest" packages = ["."] revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf" version = "v1.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "e7725ea56516a42a641aaaf5d48754258d9f3c59949cb8a0e8a21b1ab6e07179" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/remove/specific/case2/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/remove/specific/case2/final/Gopkg.toml index 6a818bfc82..0aec7f3a4d 100644 --- a/cmd/dep/testdata/harness_tests/remove/specific/case2/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/remove/specific/case2/final/Gopkg.toml @@ -1,11 +1,11 @@ -[[dependencies]] +[[constraint]] name = "github.com/not/used" version = "2.0.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" revision = "a0196baa11ea047dd65037287451d36b861b00ea" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/remove/specific/case2/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/remove/specific/case2/initial/Gopkg.toml index 6a818bfc82..0aec7f3a4d 100644 --- a/cmd/dep/testdata/harness_tests/remove/specific/case2/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/remove/specific/case2/initial/Gopkg.toml @@ -1,11 +1,11 @@ -[[dependencies]] +[[constraint]] name = "github.com/not/used" version = "2.0.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" revision = "a0196baa11ea047dd65037287451d36b861b00ea" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/remove/unused/case1/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/remove/unused/case1/final/Gopkg.lock index f5520e258f..b4a3656bec 100644 --- a/cmd/dep/testdata/harness_tests/remove/unused/case1/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/remove/unused/case1/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "722f8e1427ab6d4dd1bc92376e4ce41ba6034a74e283a3fe4d65c7c838c7e0d2" [[projects]] name = "github.com/sdboyer/deptest" @@ -12,3 +11,10 @@ memo = "722f8e1427ab6d4dd1bc92376e4ce41ba6034a74e283a3fe4d65c7c838c7e0d2" name = "github.com/sdboyer/deptestdos" packages = ["."] revision = "a0196baa11ea047dd65037287451d36b861b00ea" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "722f8e1427ab6d4dd1bc92376e4ce41ba6034a74e283a3fe4d65c7c838c7e0d2" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/remove/unused/case1/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/remove/unused/case1/final/Gopkg.toml index 6a818bfc82..0aec7f3a4d 100644 --- a/cmd/dep/testdata/harness_tests/remove/unused/case1/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/remove/unused/case1/final/Gopkg.toml @@ -1,11 +1,11 @@ -[[dependencies]] +[[constraint]] name = "github.com/not/used" version = "2.0.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" revision = "a0196baa11ea047dd65037287451d36b861b00ea" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/remove/unused/case1/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/remove/unused/case1/initial/Gopkg.toml index 6a818bfc82..0aec7f3a4d 100644 --- a/cmd/dep/testdata/harness_tests/remove/unused/case1/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/remove/unused/case1/initial/Gopkg.toml @@ -1,11 +1,11 @@ -[[dependencies]] +[[constraint]] name = "github.com/not/used" version = "2.0.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptestdos" revision = "a0196baa11ea047dd65037287451d36b861b00ea" \ No newline at end of file diff --git a/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.lock index eedf77e499..77278d07bc 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" [[projects]] name = "github.com/sdboyer/deptest" @@ -13,3 +12,10 @@ memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" packages = ["."] revision = "5c607206be5decd28e6263ffffdcee067266015e" version = "v2.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.toml index 122d0340fd..94deb714a4 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" diff --git a/cmd/dep/testdata/harness_tests/status/case1/dot/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/status/case1/dot/initial/Gopkg.toml index 122d0340fd..94deb714a4 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/dot/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/status/case1/dot/initial/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" diff --git a/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.lock index eedf77e499..77278d07bc 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" [[projects]] name = "github.com/sdboyer/deptest" @@ -13,3 +12,10 @@ memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" packages = ["."] revision = "5c607206be5decd28e6263ffffdcee067266015e" version = "v2.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.toml index 122d0340fd..94deb714a4 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" diff --git a/cmd/dep/testdata/harness_tests/status/case1/json/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/status/case1/json/initial/Gopkg.toml index 122d0340fd..94deb714a4 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/json/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/status/case1/json/initial/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" diff --git a/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.lock b/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.lock index eedf77e499..77278d07bc 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.lock +++ b/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" [[projects]] name = "github.com/sdboyer/deptest" @@ -13,3 +12,10 @@ memo = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" packages = ["."] revision = "5c607206be5decd28e6263ffffdcee067266015e" version = "v2.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.toml b/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.toml index 122d0340fd..94deb714a4 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" diff --git a/cmd/dep/testdata/harness_tests/status/case1/table/initial/Gopkg.toml b/cmd/dep/testdata/harness_tests/status/case1/table/initial/Gopkg.toml index 122d0340fd..94deb714a4 100644 --- a/cmd/dep/testdata/harness_tests/status/case1/table/initial/Gopkg.toml +++ b/cmd/dep/testdata/harness_tests/status/case1/table/initial/Gopkg.toml @@ -1,3 +1,3 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/deptest" version = "^0.8.0" diff --git a/cmd/dep/testdata/init_path_tests/relative_path/final/project_dir/Gopkg.toml b/cmd/dep/testdata/init_path_tests/relative_path/final/project_dir/Gopkg.toml index bccfadb86a..a90dd2dadd 100644 --- a/cmd/dep/testdata/init_path_tests/relative_path/final/project_dir/Gopkg.toml +++ b/cmd/dep/testdata/init_path_tests/relative_path/final/project_dir/Gopkg.toml @@ -1,7 +1,4 @@ -[[dependencies]] +[[constraint]] branch = "master" name = "github.com/sdboyer/deptest" - -[[dependencies]] - name = "github.com/sdboyer/deptestdos" diff --git a/context_test.go b/context_test.go index 951c233da4..70f3558bc1 100644 --- a/context_test.go +++ b/context_test.go @@ -282,7 +282,7 @@ func TestLoadProjectManifestParseError(t *testing.T) { tg.TempDir("src") tg.TempDir("src/test1") - tg.TempFile(filepath.Join("src/test1", ManifestName), `[[dependencies]]`) + tg.TempFile(filepath.Join("src/test1", ManifestName), `[[constraint]]`) tg.TempFile(filepath.Join("src/test1", LockName), `memo = "cdafe8641b28cd16fe025df278b0a49b9416859345d8b6ba0ace0272b74925ee"\n\n[[projects]]`) tg.Setenv("GOPATH", tg.Path(".")) @@ -308,7 +308,7 @@ func TestLoadProjectLockParseError(t *testing.T) { tg.TempDir("src") tg.TempDir("src/test1") - tg.TempFile(filepath.Join("src/test1", ManifestName), `[[dependencies]]`) + tg.TempFile(filepath.Join("src/test1", ManifestName), `[[constraint]]`) tg.TempFile(filepath.Join("src/test1", LockName), `memo = "cdafe8641b28cd16fe025df278b0a49b9416859345d8b6ba0ace0272b74925ee"\n\n[[projects]]`) tg.Setenv("GOPATH", tg.Path(".")) @@ -333,7 +333,7 @@ func TestLoadProjectNoSrcDir(t *testing.T) { defer tg.Cleanup() tg.TempDir("test1") - tg.TempFile(filepath.Join("test1", ManifestName), `[[dependencies]]`) + tg.TempFile(filepath.Join("test1", ManifestName), `[[constraint]]`) tg.TempFile(filepath.Join("test1", LockName), `memo = "cdafe8641b28cd16fe025df278b0a49b9416859345d8b6ba0ace0272b74925ee"\n\n[[projects]]`) tg.Setenv("GOPATH", tg.Path(".")) @@ -362,7 +362,7 @@ func TestCaseInsentitiveGOPATH(t *testing.T) { h.TempDir("src") h.TempDir("src/test1") - h.TempFile(filepath.Join("src/test1", ManifestName), `[[dependencies]]`) + h.TempFile(filepath.Join("src/test1", ManifestName), `[[constraint]]`) // Shuffle letter case rs := []rune(strings.ToLower(h.Path("."))) diff --git a/internal/gps/constraint_test.go b/internal/gps/constraint_test.go index ab99063919..0aaf5f1709 100644 --- a/internal/gps/constraint_test.go +++ b/internal/gps/constraint_test.go @@ -674,6 +674,28 @@ func TestSemverConstraintOps(t *testing.T) { } } +func TestSemverConstraint_ImpliedCaret(t *testing.T) { + c, _ := NewSemverConstraintIC("1.0.0") + + wantS := "^1.0.0" + gotS := c.String() + if wantS != gotS { + t.Errorf("Expected string %s, got %s", wantS, gotS) + } + + wantI := "1.0.0" + gotI := c.ImpliedCaretString() + if wantI != gotI { + t.Errorf("Expected implied string %s, got %s", wantI, gotI) + } + + wantT := "svc-^1.0.0" + gotT := c.typedString() + if wantT != gotT { + t.Errorf("Expected type string %s, got %s", wantT, gotT) + } +} + // Test that certain types of cross-version comparisons work when they are // expressed as a version union (but that others don't). func TestVersionUnion(t *testing.T) { diff --git a/internal/gps/constraints.go b/internal/gps/constraints.go index eb89467e00..143c786c9a 100644 --- a/internal/gps/constraints.go +++ b/internal/gps/constraints.go @@ -25,6 +25,14 @@ var ( type Constraint interface { fmt.Stringer + // ImpliedCaretString converts the Constraint to a string in the same manner + // as String(), but treats the empty operator as equivalent to ^, rather + // than =. + // + // In the same way that String() is the inverse of NewConstraint(), this + // method is the inverse of NewSemverConstraintIC(). + ImpliedCaretString() string + // Matches indicates if the provided Version is allowed by the Constraint. Matches(Version) bool @@ -64,6 +72,26 @@ func NewSemverConstraint(body string) (Constraint, error) { return semverConstraint{c: c}, nil } +// NewSemverConstraintIC attempts to construct a semver Constraint object from the +// input string, defaulting to a caret, ^, when no operator is specified. Put +// differently, ^ is the default operator for NewSemverConstraintIC, while = +// is the default operator for NewSemverConstraint. +// +// If the input string cannot be made into a valid semver Constraint, an error +// is returned. +func NewSemverConstraintIC(body string) (Constraint, error) { + c, err := semver.NewConstraintIC(body) + if err != nil { + return nil, err + } + // If we got a simple semver.Version, simplify by returning our + // corresponding type + if sv, ok := c.(semver.Version); ok { + return semVersion{sv: sv}, nil + } + return semverConstraint{c: c}, nil +} + type semverConstraint struct { c semver.Constraint } @@ -72,6 +100,16 @@ func (c semverConstraint) String() string { return c.c.String() } +// ImpliedCaretString converts the Constraint to a string in the same manner +// as String(), but treats the empty operator as equivalent to ^, rather +// than =. +// +// In the same way that String() is the inverse of NewConstraint(), this +// method is the inverse of NewSemverConstraintIC(). +func (c semverConstraint) ImpliedCaretString() string { + return c.c.ImpliedCaretString() +} + func (c semverConstraint) typedString() string { return fmt.Sprintf("svc-%s", c.c.String()) } @@ -153,6 +191,10 @@ func (anyConstraint) String() string { return "*" } +func (anyConstraint) ImpliedCaretString() string { + return "*" +} + func (anyConstraint) typedString() string { return "any-*" } @@ -177,6 +219,10 @@ func (noneConstraint) String() string { return "" } +func (noneConstraint) ImpliedCaretString() string { + return "" +} + func (noneConstraint) typedString() string { return "none-" } diff --git a/internal/gps/lock.go b/internal/gps/lock.go index 2e7b787e72..af728dd18f 100644 --- a/internal/gps/lock.go +++ b/internal/gps/lock.go @@ -17,9 +17,6 @@ import ( // solution is all that would be necessary to constitute a lock file, though // tools can include whatever other information they want in their storage. type Lock interface { - // Indicates the version of the solver used to generate this lock data - //SolverVersion() string - // The hash of inputs to gps that resulted in this lock data InputHash() []byte diff --git a/internal/gps/result.go b/internal/gps/result.go index 3c79ffeac8..03948ff5bd 100644 --- a/internal/gps/result.go +++ b/internal/gps/result.go @@ -14,6 +14,14 @@ import ( // additional methods that report information about the solve run. type Solution interface { Lock + // The name of the ProjectAnalyzer used in generating this solution. + AnalyzerName() string + // The version of the ProjectAnalyzer used in generating this solution. + AnalyzerVersion() int + // The name of the Solver used in generating this solution. + SolverName() string + // The version of the Solver used in generating this solution. + SolverVersion() int Attempts() int } @@ -26,6 +34,15 @@ type solution struct { // The hash digest of the input opts hd []byte + + // The analyzer name + analyzerName string + + // The analyzer version + analyzerVersion int + + // The solver used in producing this solution + solv Solver } // WriteDepTree takes a basedir and a Lock, and exports all the projects @@ -76,3 +93,19 @@ func (r solution) Attempts() int { func (r solution) InputHash() []byte { return r.hd } + +func (r solution) AnalyzerName() string { + return r.analyzerName +} + +func (r solution) AnalyzerVersion() int { + return r.analyzerVersion +} + +func (r solution) SolverName() string { + return r.solv.Name() +} + +func (r solution) SolverVersion() int { + return r.solv.Version() +} diff --git a/internal/gps/result_test.go b/internal/gps/result_test.go index 8f30bbef61..da73b47b34 100644 --- a/internal/gps/result_test.go +++ b/internal/gps/result_test.go @@ -34,6 +34,7 @@ func init() { }, nil), }, } + basicResult.analyzerName, basicResult.analyzerVersion = (naiveAnalyzer{}).Info() // Just in case something needs punishing, kubernetes offers a complex, // real-world set of dependencies, and this revision is known to work. diff --git a/internal/gps/solver.go b/internal/gps/solver.go index c3621ff262..f63accc3c6 100644 --- a/internal/gps/solver.go +++ b/internal/gps/solver.go @@ -328,6 +328,49 @@ type Solver interface { // Solve initiates a solving run. It will either complete successfully with // a Solution, or fail with an informative error. Solve() (Solution, error) + + // Name returns a string identifying the particular solver backend. + // + // Different solvers likely have different invariants, and likely will not + // have identical possible result sets for any particular inputs; in some + // cases, they may even be disjoint. + Name() string + + // Version returns an int indicating the version of the solver of the given + // Name(). Implementations should change their reported version ONLY when + // the logic is changed in such a way that substantially changes the result + // set that is possible for a substantial subset of likely inputs. + // + // "Substantial" is an imprecise term, and it is used intentionally. There + // are no easy, general ways of subdividing constraint solving problems such + // that one can know, a priori, the full impact that subtle algorithmic + // changes will have on possible result sets. Consequently, we have to fall + // back on coarser, intuition-based reasoning as to whether a change is + // large enough that it is likely to be broadly user-visible. + // + // This is acceptable, because this value is not used programmatically by + // the solver in any way. Rather, it is intend for implementing tools to + // use as a coarse signal to users about compatibility between their tool's + // version and the current data, typically via persistence to a Lock. + // Changes to the version number reported should be weighed between + // confusing teams by having two members' tools continuously rolling back + // each others' chosen Solutions for no apparent reason, and annoying teams + // by changing the number for changes so remote that warnings about solver + // version mismatches become meaningless. + // + // Err on the side of caution. + // + // Chronology is the only implication of the ordering - that lower version + // numbers were published before higher numbers. + Version() int +} + +func (s *solver) Name() string { + return "gps-cdcl" +} + +func (s *solver) Version() int { + return 1 } // Solve attempts to find a dependency solution for the given project, as @@ -351,9 +394,10 @@ func (s *solver) Solve() (Solution, error) { var soln solution if err == nil { soln = solution{ - att: s.attempts, + att: s.attempts, + solv: s, } - + soln.analyzerName, soln.analyzerVersion = s.rd.an.Info() soln.hd = s.HashInputs() // Convert ProjectAtoms into LockedProjects diff --git a/internal/gps/version.go b/internal/gps/version.go index a75e38aad6..060c5b6971 100644 --- a/internal/gps/version.go +++ b/internal/gps/version.go @@ -119,6 +119,10 @@ func (r Revision) String() string { return string(r) } +func (r Revision) ImpliedCaretString() string { + return r.String() +} + func (r Revision) typedString() string { return "r-" + string(r) } @@ -195,6 +199,10 @@ func (v branchVersion) String() string { return string(v.name) } +func (v branchVersion) ImpliedCaretString() string { + return v.String() +} + func (v branchVersion) typedString() string { return fmt.Sprintf("b-%s", v.String()) } @@ -272,6 +280,10 @@ func (v plainVersion) String() string { return string(v) } +func (v plainVersion) ImpliedCaretString() string { + return v.String() +} + func (v plainVersion) typedString() string { return fmt.Sprintf("pv-%s", v.String()) } @@ -355,6 +367,10 @@ func (v semVersion) String() string { return str } +func (v semVersion) ImpliedCaretString() string { + return v.sv.ImpliedCaretString() +} + func (v semVersion) typedString() string { return fmt.Sprintf("sv-%s", v.String()) } @@ -439,6 +455,10 @@ func (v versionPair) String() string { return v.v.String() } +func (v versionPair) ImpliedCaretString() string { + return v.v.ImpliedCaretString() +} + func (v versionPair) typedString() string { return fmt.Sprintf("%s-%s", v.Unpair().typedString(), v.Underlying().typedString()) } diff --git a/internal/gps/version_unifier.go b/internal/gps/version_unifier.go index 7f9dc5d646..d9cfb2a9ef 100644 --- a/internal/gps/version_unifier.go +++ b/internal/gps/version_unifier.go @@ -184,6 +184,13 @@ func (vtu versionTypeUnion) String() string { panic("versionTypeUnion should never be turned into a string; it is solver internal-only") } +// This should generally not be called, but is required for the interface. If it +// is called, we have a bigger problem (the type has escaped the solver); thus, +// panic. +func (vtu versionTypeUnion) ImpliedCaretString() string { + panic("versionTypeUnion should never be turned into a string; it is solver internal-only") +} + func (vtu versionTypeUnion) typedString() string { panic("versionTypeUnion should never be turned into a string; it is solver internal-only") } diff --git a/internal/test/integration_testcase.go b/internal/test/integration_testcase.go index f894d15678..35f940d140 100644 --- a/internal/test/integration_testcase.go +++ b/internal/test/integration_testcase.go @@ -145,7 +145,7 @@ func (tc *IntegrationTestCase) CompareOutput(stdout string) { stdout = normalizeLines(stdout) if expStr != stdout { - tc.t.Errorf("expected: %q but got: %q", expStr, stdout) + tc.t.Errorf("(WNT):\n%s\n(GOT):\n%s\n", expStr, stdout) } } diff --git a/lock.go b/lock.go index 3f0c02e92e..e3a3d181f5 100644 --- a/lock.go +++ b/lock.go @@ -18,13 +18,29 @@ import ( const LockName = "Gopkg.lock" type Lock struct { - Memo []byte - P []gps.LockedProject + SolveMeta SolveMeta + P []gps.LockedProject +} + +type SolveMeta struct { + Memo []byte + AnalyzerName string + AnalyzerVersion int + SolverName string + SolverVersion int } type rawLock struct { - Memo string `toml:"memo"` - Projects []rawLockedProject `toml:"projects"` + SolveMeta solveMeta `toml:"solve-meta"` + Projects []rawLockedProject `toml:"projects"` +} + +type solveMeta struct { + InputsDigest string `toml:"inputs-digest"` + AnalyzerName string `toml:"analyzer-name"` + AnalyzerVersion int `toml:"analyzer-version"` + SolverName string `toml:"solver-name"` + SolverVersion int `toml:"solver-version"` } type rawLockedProject struct { @@ -58,11 +74,16 @@ func fromRawLock(raw rawLock) (*Lock, error) { P: make([]gps.LockedProject, len(raw.Projects)), } - l.Memo, err = hex.DecodeString(raw.Memo) + l.SolveMeta.Memo, err = hex.DecodeString(raw.SolveMeta.InputsDigest) if err != nil { return nil, errors.Errorf("invalid hash digest in lock's memo field") } + l.SolveMeta.AnalyzerName = raw.SolveMeta.AnalyzerName + l.SolveMeta.AnalyzerVersion = raw.SolveMeta.AnalyzerVersion + l.SolveMeta.SolverName = raw.SolveMeta.SolverName + l.SolveMeta.SolverVersion = raw.SolveMeta.SolverVersion + for i, ld := range raw.Projects { r := gps.Revision(ld.Revision) @@ -84,11 +105,12 @@ func fromRawLock(raw rawLock) (*Lock, error) { } l.P[i] = gps.NewLockedProject(id, v, ld.Packages) } + return l, nil } func (l *Lock) InputHash() []byte { - return l.Memo + return l.SolveMeta.Memo } func (l *Lock) Projects() []gps.LockedProject { @@ -98,7 +120,13 @@ func (l *Lock) Projects() []gps.LockedProject { // toRaw converts the manifest into a representation suitable to write to the lock file func (l *Lock) toRaw() rawLock { raw := rawLock{ - Memo: hex.EncodeToString(l.Memo), + SolveMeta: solveMeta{ + InputsDigest: hex.EncodeToString(l.SolveMeta.Memo), + AnalyzerName: l.SolveMeta.AnalyzerName, + AnalyzerVersion: l.SolveMeta.AnalyzerVersion, + SolverName: l.SolveMeta.SolverName, + SolverVersion: l.SolveMeta.SolverVersion, + }, Projects: make([]rawLockedProject, len(l.P)), } @@ -129,29 +157,25 @@ func (l *Lock) MarshalTOML() ([]byte, error) { return result, errors.Wrap(err, "Unable to marshal lock to TOML string") } -// LockFromInterface converts an arbitrary gps.Lock to dep's representation of a -// lock. If the input is already dep's *lock, the input is returned directly. +// LockFromSolution converts a gps.Solution to dep's representation of a lock. // // Data is defensively copied wherever necessary to ensure the resulting *lock // shares no memory with the original lock. -// -// As gps.Solution is a superset of gps.Lock, this can also be used to convert -// solutions to dep's lock format. -func LockFromInterface(in gps.Lock) *Lock { - if in == nil { - return nil - } else if l, ok := in.(*Lock); ok { - return l - } - +func LockFromSolution(in gps.Solution) *Lock { h, p := in.InputHash(), in.Projects() l := &Lock{ - Memo: make([]byte, len(h)), - P: make([]gps.LockedProject, len(p)), + SolveMeta: SolveMeta{ + Memo: make([]byte, len(h)), + AnalyzerName: in.AnalyzerName(), + AnalyzerVersion: in.AnalyzerVersion(), + SolverName: in.SolverName(), + SolverVersion: in.SolverVersion(), + }, + P: make([]gps.LockedProject, len(p)), } - copy(l.Memo, h) + copy(l.SolveMeta.Memo, h) copy(l.P, p) return l } diff --git a/lock_test.go b/lock_test.go index 2f035756b6..3a80227ad2 100644 --- a/lock_test.go +++ b/lock_test.go @@ -28,7 +28,9 @@ func TestReadLock(t *testing.T) { b, _ := hex.DecodeString("2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e") want := &Lock{ - Memo: b, + SolveMeta: SolveMeta{ + Memo: b, + }, P: []gps.LockedProject{ gps.NewLockedProject( gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot("github.com/golang/dep/internal/gps")}, @@ -52,7 +54,9 @@ func TestReadLock(t *testing.T) { b, _ = hex.DecodeString("2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e") want = &Lock{ - Memo: b, + SolveMeta: SolveMeta{ + Memo: b, + }, P: []gps.LockedProject{ gps.NewLockedProject( gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot("github.com/golang/dep/internal/gps")}, @@ -75,7 +79,9 @@ func TestWriteLock(t *testing.T) { want := h.GetTestFileString(golden) memo, _ := hex.DecodeString("2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e") l := &Lock{ - Memo: memo, + SolveMeta: SolveMeta{ + Memo: memo, + }, P: []gps.LockedProject{ gps.NewLockedProject( gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot("github.com/golang/dep/internal/gps")}, @@ -104,7 +110,9 @@ func TestWriteLock(t *testing.T) { want = h.GetTestFileString(golden) memo, _ = hex.DecodeString("2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e") l = &Lock{ - Memo: memo, + SolveMeta: SolveMeta{ + Memo: memo, + }, P: []gps.LockedProject{ gps.NewLockedProject( gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot("github.com/golang/dep/internal/gps")}, diff --git a/manifest.go b/manifest.go index 557659bdc4..620dfec85d 100644 --- a/manifest.go +++ b/manifest.go @@ -19,17 +19,17 @@ import ( const ManifestName = "Gopkg.toml" type Manifest struct { - Dependencies gps.ProjectConstraints - Ovr gps.ProjectConstraints - Ignored []string - Required []string + Constraints gps.ProjectConstraints + Ovr gps.ProjectConstraints + Ignored []string + Required []string } type rawManifest struct { - Dependencies []rawProject `toml:"dependencies,omitempty"` - Overrides []rawProject `toml:"overrides,omitempty"` - Ignored []string `toml:"ignored,omitempty"` - Required []string `toml:"required,omitempty"` + Constraints []rawProject `toml:"constraint,omitempty"` + Overrides []rawProject `toml:"override,omitempty"` + Ignored []string `toml:"ignored,omitempty"` + Required []string `toml:"required,omitempty"` } type rawProject struct { @@ -58,7 +58,7 @@ func validateManifest(s string) ([]error, error) { if reflect.TypeOf(val).Kind() != reflect.Map { errs = append(errs, errors.New("metadata should be a TOML table")) } - case "dependencies", "overrides": + case "constraint", "override": // Invalid if type assertion fails. Not a TOML array of tables. if rawProj, ok := val.([]interface{}); ok { // Iterate through each array of tables @@ -117,21 +117,21 @@ func readManifest(r io.Reader) (*Manifest, []error, error) { func fromRawManifest(raw rawManifest) (*Manifest, error) { m := &Manifest{ - Dependencies: make(gps.ProjectConstraints, len(raw.Dependencies)), - Ovr: make(gps.ProjectConstraints, len(raw.Overrides)), - Ignored: raw.Ignored, - Required: raw.Required, + Constraints: make(gps.ProjectConstraints, len(raw.Constraints)), + Ovr: make(gps.ProjectConstraints, len(raw.Overrides)), + Ignored: raw.Ignored, + Required: raw.Required, } - for i := 0; i < len(raw.Dependencies); i++ { - name, prj, err := toProject(raw.Dependencies[i]) + for i := 0; i < len(raw.Constraints); i++ { + name, prj, err := toProject(raw.Constraints[i]) if err != nil { return nil, err } - if _, exists := m.Dependencies[name]; exists { + if _, exists := m.Constraints[name]; exists { return nil, errors.Errorf("multiple dependencies specified for %s, can only specify one", name) } - m.Dependencies[name] = prj + m.Constraints[name] = prj } for i := 0; i < len(raw.Overrides); i++ { @@ -162,7 +162,7 @@ func toProject(raw rawProject) (n gps.ProjectRoot, pp gps.ProjectProperties, err } // always semver if we can - pp.Constraint, err = gps.NewSemverConstraint(raw.Version) + pp.Constraint, err = gps.NewSemverConstraintIC(raw.Version) if err != nil { // but if not, fall back on plain versions pp.Constraint = gps.NewVersion(raw.Version) @@ -182,15 +182,15 @@ func toProject(raw rawProject) (n gps.ProjectRoot, pp gps.ProjectProperties, err // toRaw converts the manifest into a representation suitable to write to the manifest file func (m *Manifest) toRaw() rawManifest { raw := rawManifest{ - Dependencies: make([]rawProject, 0, len(m.Dependencies)), - Overrides: make([]rawProject, 0, len(m.Ovr)), - Ignored: m.Ignored, - Required: m.Required, + Constraints: make([]rawProject, 0, len(m.Constraints)), + Overrides: make([]rawProject, 0, len(m.Ovr)), + Ignored: m.Ignored, + Required: m.Required, } - for n, prj := range m.Dependencies { - raw.Dependencies = append(raw.Dependencies, toRawProject(n, prj)) + for n, prj := range m.Constraints { + raw.Constraints = append(raw.Constraints, toRawProject(n, prj)) } - sort.Sort(sortedRawProjects(raw.Dependencies)) + sort.Sort(sortedRawProjects(raw.Constraints)) for n, prj := range m.Ovr { raw.Overrides = append(raw.Overrides, toRawProject(n, prj)) @@ -236,7 +236,7 @@ func toRawProject(name gps.ProjectRoot, project gps.ProjectProperties) rawProjec case gps.IsBranch: raw.Branch = v.String() case gps.IsSemver, gps.IsVersion: - raw.Version = v.String() + raw.Version = v.ImpliedCaretString() } return raw } @@ -248,13 +248,13 @@ func toRawProject(name gps.ProjectRoot, project gps.ProjectProperties) rawProjec // if !gps.IsAny(pp.Constraint) && !gps.IsNone(pp.Constraint) { if !gps.IsAny(project.Constraint) && project.Constraint != nil { // Has to be a semver range. - raw.Version = project.Constraint.String() + raw.Version = project.Constraint.ImpliedCaretString() } return raw } func (m *Manifest) DependencyConstraints() gps.ProjectConstraints { - return m.Dependencies + return m.Constraints } func (m *Manifest) TestDependencyConstraints() gps.ProjectConstraints { diff --git a/manifest_test.go b/manifest_test.go index 7ccb021008..4b5fe0ee9f 100644 --- a/manifest_test.go +++ b/manifest_test.go @@ -25,9 +25,9 @@ func TestReadManifest(t *testing.T) { t.Fatalf("Should have read Manifest correctly, but got err %q", err) } - c, _ := gps.NewSemverConstraint(">=0.12.0, <1.0.0") + c, _ := gps.NewSemverConstraint("^0.12.0") want := Manifest{ - Dependencies: map[gps.ProjectRoot]gps.ProjectProperties{ + Constraints: map[gps.ProjectRoot]gps.ProjectProperties{ gps.ProjectRoot("github.com/golang/dep/internal/gps"): { Constraint: c, }, @@ -44,7 +44,7 @@ func TestReadManifest(t *testing.T) { Ignored: []string{"github.com/foo/bar"}, } - if !reflect.DeepEqual(got.Dependencies, want.Dependencies) { + if !reflect.DeepEqual(got.Constraints, want.Constraints) { t.Error("Valid manifest's dependencies did not parse as expected") } if !reflect.DeepEqual(got.Ovr, want.Ovr) { @@ -61,9 +61,9 @@ func TestWriteManifest(t *testing.T) { golden := "manifest/golden.toml" want := h.GetTestFileString(golden) - c, _ := gps.NewSemverConstraint(">=0.12.0, <1.0.0") + c, _ := gps.NewSemverConstraint("^0.12.0") m := &Manifest{ - Dependencies: map[gps.ProjectRoot]gps.ProjectProperties{ + Constraints: map[gps.ProjectRoot]gps.ProjectProperties{ gps.ProjectRoot("github.com/golang/dep/internal/gps"): { Constraint: c, }, @@ -128,7 +128,7 @@ func TestValidateManifest(t *testing.T) { }{ { tomlString: ` - [[dependencies]] + [[constraint]] name = "github.com/foo/bar" `, want: []error{}, @@ -149,7 +149,7 @@ func TestValidateManifest(t *testing.T) { [[bar]] author = "xyz" - [[dependencies]] + [[constraint]] name = "github.com/foo/bar" version = "" `, @@ -163,45 +163,45 @@ func TestValidateManifest(t *testing.T) { tomlString: ` metadata = "project-name" - [[dependencies]] + [[constraint]] name = "github.com/foo/bar" `, want: []error{errors.New("metadata should be a TOML table")}, }, { tomlString: ` - dependencies = "foo" - overrides = "bar" + constraint = "foo" + override = "bar" `, want: []error{ - errors.New("dependencies should be a TOML array of tables"), - errors.New("overrides should be a TOML array of tables"), + errors.New("constraint should be a TOML array of tables"), + errors.New("override should be a TOML array of tables"), }, }, { tomlString: ` - [[dependencies]] + [[constraint]] name = "github.com/foo/bar" location = "some-value" link = "some-other-value" metadata = "foo" - [[overrides]] + [[override]] nick = "foo" `, want: []error{ - errors.New("Invalid key \"location\" in \"dependencies\""), - errors.New("Invalid key \"link\" in \"dependencies\""), - errors.New("Invalid key \"nick\" in \"overrides\""), - errors.New("metadata in \"dependencies\" should be a TOML table"), + errors.New("Invalid key \"location\" in \"constraint\""), + errors.New("Invalid key \"link\" in \"constraint\""), + errors.New("Invalid key \"nick\" in \"override\""), + errors.New("metadata in \"constraint\" should be a TOML table"), }, }, { tomlString: ` - [[dependencies]] + [[constraint]] name = "github.com/foo/bar" - [dependencies.metadata] + [constraint.metadata] color = "blue" `, want: []error{}, diff --git a/testdata/analyzer/Gopkg.toml b/testdata/analyzer/Gopkg.toml index f286cc0aae..7edfc9a7a7 100644 --- a/testdata/analyzer/Gopkg.toml +++ b/testdata/analyzer/Gopkg.toml @@ -1,8 +1,8 @@ -[[dependencies]] +[[constraint]] name = "github.com/golang/dep/internal/gps" version = ">=0.12.0, <1.0.0" -[[dependencies]] +[[constraint]] name = "github.com/pkg/errors" version = ">=0.8.0, <1.0.0" diff --git a/testdata/lock/error0.toml b/testdata/lock/error0.toml index 8aca39428c..141d5bc78a 100644 --- a/testdata/lock/error0.toml +++ b/testdata/lock/error0.toml @@ -1,4 +1,5 @@ -memo = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" +[solve-meta] + inputs-digest = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" [[projects]] name = "github.com/golang/dep/internal/gps" diff --git a/testdata/lock/error1.toml b/testdata/lock/error1.toml index 344ed1118b..cf54d870cf 100644 --- a/testdata/lock/error1.toml +++ b/testdata/lock/error1.toml @@ -1,7 +1,9 @@ -memo = "000aaa2a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" - [[projects]] name = "github.com/golang/dep/internal/gps" branch = "master" revision = "d05d5aca9f895d19e9265839bffeadd74a2d2ecb" packages = ["."] + +[solve-meta] + inputs-digest = "000aaa2a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" + diff --git a/testdata/lock/error2.toml b/testdata/lock/error2.toml index d88d3e437a..788fc8c7c8 100644 --- a/testdata/lock/error2.toml +++ b/testdata/lock/error2.toml @@ -1,5 +1,7 @@ -memo = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" - [[projects]] name = "github.com/golang/dep/internal/gps" packages = ["."] + +[solve-meta] + inputs-digest = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" + diff --git a/testdata/lock/golden0.toml b/testdata/lock/golden0.toml index 35ffb6257c..2011593b48 100644 --- a/testdata/lock/golden0.toml +++ b/testdata/lock/golden0.toml @@ -1,7 +1,13 @@ -memo = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" [[projects]] branch = "master" name = "github.com/golang/dep/internal/gps" packages = ["."] revision = "d05d5aca9f895d19e9265839bffeadd74a2d2ecb" + +[solve-meta] + analyzer-name = "" + analyzer-version = 0 + inputs-digest = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" + solver-name = "" + solver-version = 0 diff --git a/testdata/lock/golden1.toml b/testdata/lock/golden1.toml index dfa34d8859..fe2941c26f 100644 --- a/testdata/lock/golden1.toml +++ b/testdata/lock/golden1.toml @@ -1,7 +1,13 @@ -memo = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" [[projects]] name = "github.com/golang/dep/internal/gps" packages = ["."] revision = "d05d5aca9f895d19e9265839bffeadd74a2d2ecb" version = "0.12.2" + +[solve-meta] + analyzer-name = "" + analyzer-version = 0 + inputs-digest = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" + solver-name = "" + solver-version = 0 diff --git a/testdata/manifest/error1.toml b/testdata/manifest/error1.toml index a8336c1ed4..f0c731eb95 100644 --- a/testdata/manifest/error1.toml +++ b/testdata/manifest/error1.toml @@ -1,13 +1,13 @@ ignored = ["github.com/foo/bar"] -[[dependencies]] +[[constraint]] name = "github.com/golang/dep/internal/gps" branch = "master" revision = "d05d5aca9f895d19e9265839bffeadd74a2d2ecb" version = "^v0.12.0" source = "https://github.com/golang/dep/internal/gps" -[[overrides]] +[[override]] name = "github.com/golang/dep/internal/gps" branch = "master" revision = "d05d5aca9f895d19e9265839bffeadd74a2d2ecb" diff --git a/testdata/manifest/error2.toml b/testdata/manifest/error2.toml index f46a0f8855..d0d799d496 100644 --- a/testdata/manifest/error2.toml +++ b/testdata/manifest/error2.toml @@ -1,9 +1,9 @@ ignored = ["github.com/foo/bar"] -[[dependencies]] +[[constraint]] name = "github.com/golang/dep/internal/gps" branch = "master" -[[dependencies]] +[[constraint]] name = "github.com/golang/dep/internal/gps" branch = "master" diff --git a/testdata/manifest/golden.toml b/testdata/manifest/golden.toml index 98b7cd3e09..8614f1fdd7 100644 --- a/testdata/manifest/golden.toml +++ b/testdata/manifest/golden.toml @@ -1,14 +1,14 @@ ignored = ["github.com/foo/bar"] -[[dependencies]] +[[constraint]] name = "github.com/babble/brook" revision = "d05d5aca9f895d19e9265839bffeadd74a2d2ecb" -[[dependencies]] +[[constraint]] name = "github.com/golang/dep/internal/gps" - version = ">=0.12.0, <1.0.0" + version = "0.12.0" -[[overrides]] +[[override]] branch = "master" name = "github.com/golang/dep/internal/gps" source = "https://github.com/golang/dep/internal/gps" diff --git a/testdata/txn_writer/expected_lock.toml b/testdata/txn_writer/expected_lock.toml index 098de18ca7..8c9310fd3b 100644 --- a/testdata/txn_writer/expected_lock.toml +++ b/testdata/txn_writer/expected_lock.toml @@ -1,9 +1,15 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -memo = "595716d270828e763c811ef79c9c41f85b1d1bfbdfe85280036405c03772206c" [[projects]] name = "github.com/sdboyer/dep-test" packages = ["."] revision = "2a3a211e171803acb82d1d5d42ceb53228f51751" version = "1.0.0" + +[solve-meta] + analyzer-name = "" + analyzer-version = 0 + inputs-digest = "595716d270828e763c811ef79c9c41f85b1d1bfbdfe85280036405c03772206c" + solver-name = "" + solver-version = 0 diff --git a/testdata/txn_writer/expected_manifest.toml b/testdata/txn_writer/expected_manifest.toml index e0e080df27..440555b00f 100644 --- a/testdata/txn_writer/expected_manifest.toml +++ b/testdata/txn_writer/expected_manifest.toml @@ -12,9 +12,10 @@ ## or in a dependency. # ignored = ["github.com/user/project/badpkg"] -## Dependencies define constraints on dependent projects. They are respected by +## Constraints are rules for how directly imported projects +## may be incorporated into the depgraph. They are respected by ## dep whether coming from the Gopkg.toml of the current project or a dependency. -# [[dependencies]] +# [[constraint]] ## Required: the root import path of the project being constrained. # name = "github.com/user/project" # @@ -27,12 +28,12 @@ ## Optional: an alternate location (URL or import path) for the project's source. # source = "https://github.com/myfork/package.git" -## Overrides have the same structure as [[dependencies]], but supercede all -## [[dependencies]] declarations from all projects. Only the current project's -## [[overrides]] are applied. +## Override have the same structure as [[constraint]], but supercede all +## [[constraint]] declarations from all projects. Only the current project's +## [[override]] is applied. ## -## Overrides are a sledgehammer. Use them only as a last resort. -# [[overrides]] +## Override is a sledgehammer. Use them only as a last resort. +# [[override]] ## Required: the root import path of the project being constrained. # name = "github.com/user/project" # @@ -51,6 +52,6 @@ -[[dependencies]] +[[constraint]] name = "github.com/sdboyer/dep-test" version = "1.0.0" diff --git a/testdata/txn_writer/original_lock.toml b/testdata/txn_writer/original_lock.toml index 1a9384efa7..2651064873 100644 --- a/testdata/txn_writer/original_lock.toml +++ b/testdata/txn_writer/original_lock.toml @@ -1,4 +1,5 @@ -memo = "595716d270828e763c811ef79c9c41f85b1d1bfbdfe85280036405c03772206c" +[solve-meta] + inputs-digest = "595716d270828e763c811ef79c9c41f85b1d1bfbdfe85280036405c03772206c" [[projects]] name = "github.com/foo/bar" diff --git a/testdata/txn_writer/updated_lock.toml b/testdata/txn_writer/updated_lock.toml index da44aa9a21..81ae83ba34 100644 --- a/testdata/txn_writer/updated_lock.toml +++ b/testdata/txn_writer/updated_lock.toml @@ -1,4 +1,5 @@ -memo = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" +[solve-meta] + inputs-digest = "2252a285ab27944a4d7adcba8dbd03980f59ba652f12db39fa93b927c345593e" [[projects]] name = "github.com/foo/bar" diff --git a/txn_writer.go b/txn_writer.go index 74adaf7465..04e606fa0e 100644 --- a/txn_writer.go +++ b/txn_writer.go @@ -37,9 +37,10 @@ var exampleTOML = []byte(` ## or in a dependency. # ignored = ["github.com/user/project/badpkg"] -## Dependencies define constraints on dependent projects. They are respected by +## Constraints are rules for how directly imported projects +## may be incorporated into the depgraph. They are respected by ## dep whether coming from the Gopkg.toml of the current project or a dependency. -# [[dependencies]] +# [[constraint]] ## Required: the root import path of the project being constrained. # name = "github.com/user/project" # @@ -52,12 +53,12 @@ var exampleTOML = []byte(` ## Optional: an alternate location (URL or import path) for the project's source. # source = "https://github.com/myfork/package.git" -## Overrides have the same structure as [[dependencies]], but supercede all -## [[dependencies]] declarations from all projects. Only the current project's -## [[overrides]] are applied. +## Override have the same structure as [[constraint]], but supercede all +## [[constraint]] declarations from all projects. Only the current project's +## [[override]] is applied. ## -## Overrides are a sledgehammer. Use them only as a last resort. -# [[overrides]] +## Override is a sledgehammer. Use them only as a last resort. +# [[override]] ## Required: the root import path of the project being constrained. # name = "github.com/user/project" # diff --git a/txn_writer_test.go b/txn_writer_test.go index 59476cc847..5c340907ee 100644 --- a/txn_writer_test.go +++ b/txn_writer_test.go @@ -261,18 +261,18 @@ func TestSafeWriter_ModifiedLock(t *testing.T) { originalLock := new(Lock) *originalLock = *pc.Project.Lock - originalLock.Memo = []byte{} // zero out the input hash to ensure non-equivalency + originalLock.SolveMeta.Memo = []byte{} // zero out the input hash to ensure non-equivalency sw, _ := NewSafeWriter(nil, originalLock, pc.Project.Lock, VendorOnChanged) // Verify prepared actions if sw.HasManifest() { - t.Fatal("Did not expect the payload to contain the manifest") + t.Fatal("Did not expect the manifest to be written") } if !sw.HasLock() { - t.Fatal("Expected the payload to contain the lock") + t.Fatal("Expected that the writer should plan to write the lock") } if !sw.writeVendor { - t.Fatal("Expected the payload to contain the vendor directory") + t.Fatal("Expected that the writer should plan to write the vendor directory") } // Write changes @@ -308,7 +308,7 @@ func TestSafeWriter_ModifiedLockSkipVendor(t *testing.T) { originalLock := new(Lock) *originalLock = *pc.Project.Lock - originalLock.Memo = []byte{} // zero out the input hash to ensure non-equivalency + originalLock.SolveMeta.Memo = []byte{} // zero out the input hash to ensure non-equivalency sw, _ := NewSafeWriter(nil, originalLock, pc.Project.Lock, VendorNever) // Verify prepared actions diff --git a/vendor/github.com/pelletier/go-toml/marshal_test.go b/vendor/github.com/pelletier/go-toml/marshal_test.go index e2db67fce5..891222e9b1 100644 --- a/vendor/github.com/pelletier/go-toml/marshal_test.go +++ b/vendor/github.com/pelletier/go-toml/marshal_test.go @@ -145,8 +145,8 @@ var docData = testDoc{ Second: &subdoc, }, SubDocList: []testSubDoc{ - {"List.First", 0}, - {"List.Second", 0}, + testSubDoc{"List.First", 0}, + testSubDoc{"List.Second", 0}, }, SubDocPtrs: []*testSubDoc{&subdoc}, } @@ -504,7 +504,7 @@ var strPtr = []*string{&str1, &str2} var strPtr2 = []*[]*string{&strPtr} var nestedTestData = nestedMarshalTestStruct{ - String: [][]string{{"Five", "Six"}, {"One", "Two"}}, + String: [][]string{[]string{"Five", "Six"}, []string{"One", "Two"}}, StringPtr: &strPtr2, } diff --git a/vendor/github.com/pelletier/go-toml/tomltree_create_test.go b/vendor/github.com/pelletier/go-toml/tomltree_create_test.go index 7e683fd1ba..6c1496835e 100644 --- a/vendor/github.com/pelletier/go-toml/tomltree_create_test.go +++ b/vendor/github.com/pelletier/go-toml/tomltree_create_test.go @@ -1,9 +1,9 @@ package toml import ( - "strconv" "testing" "time" + "strconv" ) type customString string @@ -60,7 +60,7 @@ func TestTomlTreeCreateToTree(t *testing.T) { }, "array": []string{"a", "b", "c"}, "array_uint": []uint{uint(1), uint(2)}, - "array_table": []map[string]interface{}{{"sub_map": 52}}, + "array_table": []map[string]interface{}{map[string]interface{}{"sub_map": 52}}, "array_times": []time.Time{time.Now(), time.Now()}, "map_times": map[string]time.Time{"now": time.Now()}, "custom_string_map_key": map[customString]interface{}{customString("custom"): "custom"}, @@ -97,7 +97,7 @@ func TestTomlTreeCreateToTreeInvalidArrayMemberType(t *testing.T) { } func TestTomlTreeCreateToTreeInvalidTableGroupType(t *testing.T) { - _, err := TreeFromMap(map[string]interface{}{"foo": []map[string]interface{}{{"hello": t}}}) + _, err := TreeFromMap(map[string]interface{}{"foo": []map[string]interface{}{map[string]interface{}{"hello": t}}}) expected := "cannot convert type *testing.T to TomlTree" if err.Error() != expected { t.Fatalf("expected error %s, got %s", expected, err.Error()) diff --git a/vendor/github.com/pelletier/go-toml/tomltree_write.go b/vendor/github.com/pelletier/go-toml/tomltree_write.go index 4df87eba0f..6a7fa17458 100644 --- a/vendor/github.com/pelletier/go-toml/tomltree_write.go +++ b/vendor/github.com/pelletier/go-toml/tomltree_write.go @@ -4,11 +4,11 @@ import ( "bytes" "fmt" "io" - "reflect" "sort" "strconv" "strings" "time" + "reflect" ) // encodes a string to a TOML-compliant string value