Skip to content

Commit

Permalink
GODRIVER-2800 Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvasquez committed Apr 26, 2024
2 parents 6759bf1 + b50f397 commit 1d4ced6
Show file tree
Hide file tree
Showing 328 changed files with 7,396 additions and 7,106 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
- package-ecosystem: gomod
directory: /
schedule:
interval: "weekly"
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -153,7 +153,8 @@ evg-test-load-balancers:

.PHONY: evg-test-search-index
evg-test-search-index:
go test ./internal/integration -run TestSearchIndexProse -v -timeout $(TEST_TIMEOUT)s >> test.suite
# Double the timeout to wait for the responses from the server.
go test ./internal/integration -run TestSearchIndexProse -v -timeout $(shell echo "$$(( $(TEST_TIMEOUT) * 2))")s >> test.suite

.PHONY: evg-test-ocsp
evg-test-ocsp:
Expand Down
11 changes: 5 additions & 6 deletions bson/bsoncodec/array_codec.go → bson/array_codec.go
Expand Up @@ -4,12 +4,11 @@
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

package bsoncodec
package bson

import (
"reflect"

"go.mongodb.org/mongo-driver/bson/bsonrw"
"go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
)

Expand All @@ -30,17 +29,17 @@ func NewArrayCodec() *ArrayCodec {
}

// EncodeValue is the ValueEncoder for bsoncore.Array values.
func (ac *ArrayCodec) EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
func (ac *ArrayCodec) EncodeValue(_ EncodeContext, vw ValueWriter, val reflect.Value) error {
if !val.IsValid() || val.Type() != tCoreArray {
return ValueEncoderError{Name: "CoreArrayEncodeValue", Types: []reflect.Type{tCoreArray}, Received: val}
}

arr := val.Interface().(bsoncore.Array)
return bsonrw.Copier{}.CopyArrayFromBytes(vw, arr)
return copyArrayFromBytes(vw, arr)
}

// DecodeValue is the ValueDecoder for bsoncore.Array values.
func (ac *ArrayCodec) DecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
func (ac *ArrayCodec) DecodeValue(_ DecodeContext, vr ValueReader, val reflect.Value) error {
if !val.CanSet() || val.Type() != tCoreArray {
return ValueDecoderError{Name: "CoreArrayDecodeValue", Types: []reflect.Type{tCoreArray}, Received: val}
}
Expand All @@ -50,7 +49,7 @@ func (ac *ArrayCodec) DecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val re
}

val.SetLen(0)
arr, err := bsonrw.Copier{}.AppendArrayBytes(val.Interface().(bsoncore.Array), vr)
arr, err := appendArrayBytes(val.Interface().(bsoncore.Array), vr)
val.Set(reflect.ValueOf(arr))
return err
}
50 changes: 0 additions & 50 deletions bson/bson.go

This file was deleted.

24 changes: 1 addition & 23 deletions bson/bson_corpus_spec_test.go
Expand Up @@ -11,7 +11,6 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"math"
"os"
"path"
"reflect"
Expand All @@ -22,7 +21,6 @@ import (
"unicode/utf8"

"github.com/google/go-cmp/cmp"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/internal/assert"
"go.mongodb.org/mongo-driver/internal/require"
)
Expand Down Expand Up @@ -185,26 +183,6 @@ func unescapeUnicode(s, bsonType string) string {
return newS
}

func formatDouble(f float64) string {
var s string
if math.IsInf(f, 1) {
s = "Infinity"
} else if math.IsInf(f, -1) {
s = "-Infinity"
} else if math.IsNaN(f) {
s = "NaN"
} else {
// Print exactly one decimalType place for integers; otherwise, print as many are necessary to
// perfectly represent it.
s = strconv.FormatFloat(f, 'G', -1, 64)
if !strings.ContainsRune(s, 'E') && !strings.ContainsRune(s, '.') {
s += ".0"
}
}

return s
}

func normalizeCanonicalDouble(t *testing.T, key string, cEJ string) string {
// Unmarshal string into map
cEJMap := make(map[string]map[string]string)
Expand Down Expand Up @@ -410,7 +388,7 @@ func runTest(t *testing.T, file string) {
for _, elem := range doc {
value := reflect.ValueOf(elem.Value)
invalidString := (value.Kind() == reflect.String) && !utf8.ValidString(value.String())
dbPtr, ok := elem.Value.(primitive.DBPointer)
dbPtr, ok := elem.Value.(DBPointer)
invalidDBPtr := ok && !utf8.ValidString(dbPtr.DB)

if invalidString || invalidDBPtr {
Expand Down

0 comments on commit 1d4ced6

Please sign in to comment.