mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump github.com/gin-contrib/sessions from 0.0.5 to 1.0.0 (#2782)
This commit is contained in:
13
vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go
generated
vendored
13
vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go
generated
vendored
@@ -7,6 +7,7 @@
|
||||
package bsonrw
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
@@ -16,11 +17,15 @@ import (
|
||||
)
|
||||
|
||||
// ExtJSONValueReaderPool is a pool for ValueReaders that read ExtJSON.
|
||||
//
|
||||
// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0.
|
||||
type ExtJSONValueReaderPool struct {
|
||||
pool sync.Pool
|
||||
}
|
||||
|
||||
// NewExtJSONValueReaderPool instantiates a new ExtJSONValueReaderPool.
|
||||
//
|
||||
// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0.
|
||||
func NewExtJSONValueReaderPool() *ExtJSONValueReaderPool {
|
||||
return &ExtJSONValueReaderPool{
|
||||
pool: sync.Pool{
|
||||
@@ -32,6 +37,8 @@ func NewExtJSONValueReaderPool() *ExtJSONValueReaderPool {
|
||||
}
|
||||
|
||||
// Get retrieves a ValueReader from the pool and uses src as the underlying ExtJSON.
|
||||
//
|
||||
// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0.
|
||||
func (bvrp *ExtJSONValueReaderPool) Get(r io.Reader, canonical bool) (ValueReader, error) {
|
||||
vr := bvrp.pool.Get().(*extJSONValueReader)
|
||||
return vr.reset(r, canonical)
|
||||
@@ -39,6 +46,8 @@ func (bvrp *ExtJSONValueReaderPool) Get(r io.Reader, canonical bool) (ValueReade
|
||||
|
||||
// Put inserts a ValueReader into the pool. If the ValueReader is not a ExtJSON ValueReader nothing
|
||||
// is inserted into the pool and ok will be false.
|
||||
//
|
||||
// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0.
|
||||
func (bvrp *ExtJSONValueReaderPool) Put(vr ValueReader) (ok bool) {
|
||||
bvr, ok := vr.(*extJSONValueReader)
|
||||
if !ok {
|
||||
@@ -605,7 +614,7 @@ func (ejvr *extJSONValueReader) ReadElement() (string, ValueReader, error) {
|
||||
name, t, err := ejvr.p.readKey()
|
||||
|
||||
if err != nil {
|
||||
if err == ErrEOD {
|
||||
if errors.Is(err, ErrEOD) {
|
||||
if ejvr.stack[ejvr.frame].mode == mCodeWithScope {
|
||||
_, err := ejvr.p.peekType()
|
||||
if err != nil {
|
||||
@@ -632,7 +641,7 @@ func (ejvr *extJSONValueReader) ReadValue() (ValueReader, error) {
|
||||
|
||||
t, err := ejvr.p.peekType()
|
||||
if err != nil {
|
||||
if err == ErrEOA {
|
||||
if errors.Is(err, ErrEOA) {
|
||||
ejvr.pop()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user