Compare commits

..

3 Commits

Author SHA1 Message Date
0006c6859d v0.0.150 2023-06-07 17:48:36 +02:00
827b3fc1b7 v0.0.149 2023-06-07 17:45:45 +02:00
f7dce4a102 v0.0.148 2023-06-07 17:22:38 +02:00
3 changed files with 14 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
package goext
const GoextVersion = "0.0.147"
const GoextVersion = "0.0.150"
const GoextVersionTimestamp = "2023-06-07T16:58:17+0200"
const GoextVersionTimestamp = "2023-06-07T17:48:36+0200"

View File

@@ -50,6 +50,10 @@ func (pss PrimitiveStringSerializer) ValueFromString(str string, outType reflect
return reflect.Zero(outType).Interface(), nil // = nil.(outType), nil
}
if str == "" {
return reflect.Zero(outType).Interface(), nil // = <default>(outType), nil
}
if outType.Kind() == reflect.Ptr {
innerValue, err := pss.ValueFromString(str, outType.Elem())

View File

@@ -4,6 +4,7 @@ import (
"gogs.mikescher.com/BlackForestBytes/goext/langext"
"gogs.mikescher.com/BlackForestBytes/goext/reflectext"
"reflect"
"strings"
)
func (c *Coll[TData]) init() {
@@ -32,7 +33,13 @@ func (c *Coll[TData]) initFields(prefix string, rval reflect.Value, idxarr []int
}
bsonkey, found := rsfield.Tag.Lookup("bson")
if !found || bsonkey == "-" {
if !found {
continue
}
if strings.Contains(bsonkey, ",") {
bsonkey = bsonkey[:strings.Index(bsonkey, ",")]
}
if bsonkey == "-" {
continue
}