Skip to content

Commit 8b3929d

Browse files
committed
correct to a panic instead of returning 0
1 parent 5ac0f9f commit 8b3929d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x/bsonx/bsoncore/value.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (v Value) AsInt64OK() (int64, bool) {
190190
// will panic.
191191
func (v Value) AsFloat64() float64 {
192192
if !v.IsNumber() {
193-
return 0
193+
panic(ElementTypeError{"bsoncore.Value.AsFloat64", v.Type})
194194
}
195195
var f64 float64
196196
switch v.Type {

0 commit comments

Comments
 (0)