mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-24 18:10:52 +00:00
Update Vendor (#16325)
* Add Dependencie Update Script * update gitea.com/lunny/levelqueue * update github.com/PuerkitoBio/goquery * update github.com/alecthomas/chroma * update github.com/blevesearch/bleve/v2 * update github.com/caddyserver/certmagic * update github.com/go-enry/go-enry/v2 * update github.com/go-redis/redis/v8 * update github.com/hashicorp/golang-lru * update github.com/klauspost/compress * update github.com/markbates/goth * update github.com/mholt/archiver/v3 * update github.com/microcosm-cc/bluemonday * update github.com/minio/minio-go/v7 * update github.com/olivere/elastic/v7 * update github.com/xanzy/go-gitlab * update github.com/yuin/goldmark
This commit is contained in:
parent
65ae46bc20
commit
fae07cbc8f
319 changed files with 33568 additions and 21050 deletions
43
vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go
generated
vendored
43
vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go
generated
vendored
|
@ -94,7 +94,8 @@ type Files struct {
|
|||
// Note that enum values are in the top-level since that are in the same
|
||||
// scope as the parent enum.
|
||||
descsByName map[protoreflect.FullName]interface{}
|
||||
filesByPath map[string]protoreflect.FileDescriptor
|
||||
filesByPath map[string][]protoreflect.FileDescriptor
|
||||
numFiles int
|
||||
}
|
||||
|
||||
type packageDescriptor struct {
|
||||
|
@ -117,17 +118,16 @@ func (r *Files) RegisterFile(file protoreflect.FileDescriptor) error {
|
|||
r.descsByName = map[protoreflect.FullName]interface{}{
|
||||
"": &packageDescriptor{},
|
||||
}
|
||||
r.filesByPath = make(map[string]protoreflect.FileDescriptor)
|
||||
r.filesByPath = make(map[string][]protoreflect.FileDescriptor)
|
||||
}
|
||||
path := file.Path()
|
||||
if prev := r.filesByPath[path]; prev != nil {
|
||||
if prev := r.filesByPath[path]; len(prev) > 0 {
|
||||
r.checkGenProtoConflict(path)
|
||||
err := errors.New("file %q is already registered", file.Path())
|
||||
err = amendErrorWithCaller(err, prev, file)
|
||||
if r == GlobalFiles && ignoreConflict(file, err) {
|
||||
err = nil
|
||||
err = amendErrorWithCaller(err, prev[0], file)
|
||||
if !(r == GlobalFiles && ignoreConflict(file, err)) {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
for name := file.Package(); name != ""; name = name.Parent() {
|
||||
|
@ -168,7 +168,8 @@ func (r *Files) RegisterFile(file protoreflect.FileDescriptor) error {
|
|||
rangeTopLevelDescriptors(file, func(d protoreflect.Descriptor) {
|
||||
r.descsByName[d.FullName()] = d
|
||||
})
|
||||
r.filesByPath[path] = file
|
||||
r.filesByPath[path] = append(r.filesByPath[path], file)
|
||||
r.numFiles++
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -308,6 +309,7 @@ func (s *nameSuffix) Pop() (name protoreflect.Name) {
|
|||
// FindFileByPath looks up a file by the path.
|
||||
//
|
||||
// This returns (nil, NotFound) if not found.
|
||||
// This returns an error if multiple files have the same path.
|
||||
func (r *Files) FindFileByPath(path string) (protoreflect.FileDescriptor, error) {
|
||||
if r == nil {
|
||||
return nil, NotFound
|
||||
|
@ -316,13 +318,19 @@ func (r *Files) FindFileByPath(path string) (protoreflect.FileDescriptor, error)
|
|||
globalMutex.RLock()
|
||||
defer globalMutex.RUnlock()
|
||||
}
|
||||
if fd, ok := r.filesByPath[path]; ok {
|
||||
return fd, nil
|
||||
fds := r.filesByPath[path]
|
||||
switch len(fds) {
|
||||
case 0:
|
||||
return nil, NotFound
|
||||
case 1:
|
||||
return fds[0], nil
|
||||
default:
|
||||
return nil, errors.New("multiple files named %q", path)
|
||||
}
|
||||
return nil, NotFound
|
||||
}
|
||||
|
||||
// NumFiles reports the number of registered files.
|
||||
// NumFiles reports the number of registered files,
|
||||
// including duplicate files with the same name.
|
||||
func (r *Files) NumFiles() int {
|
||||
if r == nil {
|
||||
return 0
|
||||
|
@ -331,10 +339,11 @@ func (r *Files) NumFiles() int {
|
|||
globalMutex.RLock()
|
||||
defer globalMutex.RUnlock()
|
||||
}
|
||||
return len(r.filesByPath)
|
||||
return r.numFiles
|
||||
}
|
||||
|
||||
// RangeFiles iterates over all registered files while f returns true.
|
||||
// If multiple files have the same name, RangeFiles iterates over all of them.
|
||||
// The iteration order is undefined.
|
||||
func (r *Files) RangeFiles(f func(protoreflect.FileDescriptor) bool) {
|
||||
if r == nil {
|
||||
|
@ -344,9 +353,11 @@ func (r *Files) RangeFiles(f func(protoreflect.FileDescriptor) bool) {
|
|||
globalMutex.RLock()
|
||||
defer globalMutex.RUnlock()
|
||||
}
|
||||
for _, file := range r.filesByPath {
|
||||
if !f(file) {
|
||||
return
|
||||
for _, files := range r.filesByPath {
|
||||
for _, file := range files {
|
||||
if !f(file) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue