mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-10 10:53:36 +02:00
Improved healthcheck, idlewatcher support for loadbalanced routes, bug fixes
This commit is contained in:
@@ -99,12 +99,10 @@ func Serialize(data any) (SerializedObject, E.NestedError) {
|
||||
continue // Ignore this field if the tag is "-"
|
||||
}
|
||||
if strings.Contains(jsonTag, ",omitempty") {
|
||||
if field.Type.Kind() == reflect.Ptr && value.Field(i).IsNil() {
|
||||
continue
|
||||
}
|
||||
if value.Field(i).IsZero() {
|
||||
continue
|
||||
}
|
||||
jsonTag = strings.Replace(jsonTag, ",omitempty", "", 1)
|
||||
}
|
||||
|
||||
// If the json tag is not empty, use it as the key
|
||||
|
||||
Reference in New Issue
Block a user