mirror of
https://github.com/golang/go
synced 2024-11-21 17:14:45 -07:00
cmd/go: let list -m -json include an Origin
MergeOrigin will work when m1 or m2 both not nil. But if one of it is nil. It should return other one which is not nil. Fixes #67363
This commit is contained in:
parent
377646589d
commit
1299733f3b
@ -166,8 +166,11 @@ func addUpdate(ctx context.Context, m *modinfo.ModulePublic) {
|
||||
// If the two origins conflict including if either is nil,
|
||||
// mergeOrigin returns nil.
|
||||
func mergeOrigin(m1, m2 *codehost.Origin) *codehost.Origin {
|
||||
if m1 == nil || m2 == nil {
|
||||
return nil
|
||||
if m1 == nil {
|
||||
return m2
|
||||
}
|
||||
if m2 == nil {
|
||||
return m1
|
||||
}
|
||||
|
||||
if m2.VCS != m1.VCS ||
|
||||
|
Loading…
Reference in New Issue
Block a user