From 5b3352dc16517996fb951394bcbbe913a2a616e3 Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Fri, 9 Dec 2016 16:18:11 -0800 Subject: [PATCH] dep: Use the returned solution for the lock Instead of trying to be fancy about things, just use the returned solution data for the lock --- ensure.go | 17 +++-------------- lock.json | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/ensure.go b/ensure.go index 885bc955..c342c9ef 100644 --- a/ensure.go +++ b/ensure.go @@ -140,23 +140,12 @@ func runEnsure(args []string) error { } solution, err := solver.Solve() if err != nil { + handleAllTheFailuresOfTheWorld(err) return errors.Wrap(err, "ensure Solve()") } - ours := p.l.Projects() - for _, lp := range solution.Projects() { - i := lp.Ident() - var have bool - for _, op := range ours { - if op.Ident() == i { - have = true - break - } - } - if !have { - p.l.P = append(p.l.P, lp) - } - } + p.l.P = solution.Projects() + p.l.Memo = solution.InputHash() tv, err := ioutil.TempDir("", "vendor") if err != nil { diff --git a/lock.json b/lock.json index 2fae494e..bc0f9b19 100644 --- a/lock.json +++ b/lock.json @@ -1,5 +1,5 @@ { - "memo": "", + "memo": "7c9a217ce2f61a2f2fdaa6db60e4e0f9b495aadaf3db51e19a475bbb19cb126c", "projects": [ { "name": "github.com/Masterminds/semver",