VOL-2265 test go.mod and vendor consistency;
Update dependencies to resolve `410 Gone` errors when fetching modules
Change-Id: If0bdbc1b6d629ce819b9fa4701c016df812f92d5
diff --git a/vendor/github.com/jhump/protoreflect/desc/internal/source_info.go b/vendor/github.com/jhump/protoreflect/desc/internal/source_info.go
index 4d7dbae..b4150b8 100644
--- a/vendor/github.com/jhump/protoreflect/desc/internal/source_info.go
+++ b/vendor/github.com/jhump/protoreflect/desc/internal/source_info.go
@@ -6,16 +6,26 @@
// SourceInfoMap is a map of paths in a descriptor to the corresponding source
// code info.
-type SourceInfoMap map[string]*dpb.SourceCodeInfo_Location
+type SourceInfoMap map[string][]*dpb.SourceCodeInfo_Location
-// Get returns the source code info for the given path.
+// Get returns the source code info for the given path. If there are
+// multiple locations for the same path, the first one is returned.
func (m SourceInfoMap) Get(path []int32) *dpb.SourceCodeInfo_Location {
+ v := m[asMapKey(path)]
+ if len(v) > 0 {
+ return v[0]
+ }
+ return nil
+}
+
+// GetAll returns all source code info for the given path.
+func (m SourceInfoMap) GetAll(path []int32) []*dpb.SourceCodeInfo_Location {
return m[asMapKey(path)]
}
-// Put stores the given source code info for the given path.
-func (m SourceInfoMap) Put(path []int32, loc *dpb.SourceCodeInfo_Location) {
- m[asMapKey(path)] = loc
+// Add stores the given source code info for the given path.
+func (m SourceInfoMap) Add(path []int32, loc *dpb.SourceCodeInfo_Location) {
+ m[asMapKey(path)] = append(m[asMapKey(path)], loc)
}
// PutIfAbsent stores the given source code info for the given path only if the
@@ -26,7 +36,7 @@
if _, ok := m[k]; ok {
return false
}
- m[k] = loc
+ m[k] = []*dpb.SourceCodeInfo_Location{loc}
return true
}
@@ -40,12 +50,13 @@
//return array.Interface()
b := make([]byte, len(slice)*4)
- for i, s := range slice {
- j := i * 4
+ j := 0
+ for _, s := range slice {
b[j] = byte(s)
b[j+1] = byte(s >> 8)
b[j+2] = byte(s >> 16)
b[j+3] = byte(s >> 24)
+ j += 4
}
return string(b)
}
@@ -62,7 +73,7 @@
// the given file descriptor.
func PopulateSourceInfoMap(fd *dpb.FileDescriptorProto, m SourceInfoMap) {
for _, l := range fd.GetSourceCodeInfo().GetLocation() {
- m.Put(l.Path, l)
+ m.Add(l.Path, l)
}
}
diff --git a/vendor/github.com/jhump/protoreflect/desc/internal/util.go b/vendor/github.com/jhump/protoreflect/desc/internal/util.go
index d5197f1..139c9cd 100644
--- a/vendor/github.com/jhump/protoreflect/desc/internal/util.go
+++ b/vendor/github.com/jhump/protoreflect/desc/internal/util.go
@@ -105,6 +105,9 @@
// Field_typeTag is the tag number of the type element in a field descriptor
// proto.
Field_typeTag = 5
+ // Field_typeNameTag is the tag number of the type name element in a field
+ // descriptor proto.
+ Field_typeNameTag = 6
// Field_defaultTag is the tag number of the default value element in a
// field descriptor proto.
Field_defaultTag = 7