]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/mvs: don't emit duplicates from Req
authorBryan C. Mills <bcmills@google.com>
Thu, 28 Jan 2021 15:18:24 +0000 (10:18 -0500)
committerBryan C. Mills <bcmills@google.com>
Thu, 18 Feb 2021 17:57:36 +0000 (17:57 +0000)
commita76efea1fe18045ecb8d1cf2c1104208e636fbae
tree11467b01350160cdcd84e2b53bc627b5e91a1d4e
parent609d82b28992e6a7fac48add680f170c4eee83fd
cmd/go/internal/mvs: don't emit duplicates from Req

Req is supposed to return “a minimal requirement list”
that includes each of the module paths listed in base.
Currently, if base contains duplicates Req emits duplicates,
and a list containing duplicates is certainly not minimal.

That, in turn, requires callers to be careful to deduplicate the base
slice, and there are multiple callers that are already quite
complicated to reason about even without the added complication of
deduplicating slices.

For #36460

Change-Id: I391a1dc0641fe1dd424c16b7a1082da0d00c7292
Reviewed-on: https://go-review.googlesource.com/c/go/+/287632
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/mvs/mvs.go
src/cmd/go/internal/mvs/mvs_test.go