DateTime/LocalDate/LocalTime implementation

This commit is contained in:
Thomas Pelletier
2021-02-10 20:58:22 -05:00
parent 2341b4df00
commit 9ac08febd2
3 changed files with 338 additions and 5 deletions
+7 -1
View File
@@ -178,7 +178,7 @@ func (b *Builder) DigField(s string) error {
g, err := b.fieldGetter(t.Type(), s)
if err != nil {
return err
return FieldNotFoundError{FieldName: s, Struct: t}
}
f := g(t)
@@ -333,6 +333,12 @@ func (b *Builder) SetInt(n int64) error {
return nil
}
func (b *Builder) Set(v reflect.Value) error {
t := b.top()
t.Set(v)
return nil
}
func checkKindInt(rt reflect.Type) error {
switch rt.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: