v0.0.322 bf SecondsF64
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m1s

This commit is contained in:
Mike Schwörer 2023-11-14 16:31:05 +01:00
parent 88642770c5
commit c534e998e8
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
package goext package goext
const GoextVersion = "0.0.321" const GoextVersion = "0.0.322"
const GoextVersionTimestamp = "2023-11-14T16:00:14+0100" const GoextVersionTimestamp = "2023-11-14T16:31:05+0100"

View File

@ -73,12 +73,12 @@ func (d *SecondsF64) UnmarshalBSONValue(bt bsontype.Type, data []byte) error {
if bt != bson.TypeDouble { if bt != bson.TypeDouble {
return errors.New(fmt.Sprintf("cannot unmarshal %v into SecondsF64", bt)) return errors.New(fmt.Sprintf("cannot unmarshal %v into SecondsF64", bt))
} }
var tt float64 var secValue float64
err := bson.RawValue{Type: bt, Value: data}.Unmarshal(&tt) err := bson.RawValue{Type: bt, Value: data}.Unmarshal(&secValue)
if err != nil { if err != nil {
return err return err
} }
*d = SecondsF64(tt) *d = SecondsF64(int64(secValue * float64(time.Second)))
return nil return nil
} }