v0.0.470 Add GoextJsonMarshaller interface to call when marshalling json via gojson
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m51s

This commit is contained in:
2024-06-11 19:34:48 +02:00
parent 2504ef00a0
commit 7fc73f1e93
4 changed files with 59 additions and 2 deletions

View File

@@ -769,6 +769,13 @@ type structFields struct {
}
func (se structEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) {
if v.CanAddr() && v.Addr().Type().Implements(goextJsonMarshallerType) {
if gejm, ok := v.Addr().Interface().(GoextJsonMarshaller); ok {
gejm.PreGoJsonMarshal()
}
}
next := byte('{')
FieldLoop:
for i := range se.fields.list {