use go 1.13 (#8088)
* use go 1.13 * use go 1.13 in gomod file * Update Makefile * update swagger deps
This commit is contained in:
parent
d0ad47bd5d
commit
3f5cdfe359
121 changed files with 759 additions and 12620 deletions
10
vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go
generated
vendored
10
vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go
generated
vendored
|
@ -10,6 +10,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
||||
|
@ -160,6 +161,13 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r
|
|||
}
|
||||
|
||||
fd, exists := sd.fm[name]
|
||||
if !exists {
|
||||
// if the original name isn't found in the struct description, try again with the name in lowercase
|
||||
// this could match if a BSON tag isn't specified because by default, describeStruct lowercases all field
|
||||
// names
|
||||
fd, exists = sd.fm[strings.ToLower(name)]
|
||||
}
|
||||
|
||||
if !exists {
|
||||
if sd.inlineMap < 0 {
|
||||
// The encoding/json package requires a flag to return on error for non-existent fields.
|
||||
|
@ -195,7 +203,7 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r
|
|||
}
|
||||
field = field.Addr()
|
||||
|
||||
dctx := DecodeContext{Registry: r.Registry, Truncate: fd.truncate}
|
||||
dctx := DecodeContext{Registry: r.Registry, Truncate: fd.truncate || r.Truncate}
|
||||
if fd.decoder == nil {
|
||||
return ErrNoDecoder{Type: field.Elem().Type()}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue