mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-17 14:09:44 +02:00
improved health check
This commit is contained in:
@@ -98,6 +98,14 @@ func Serialize(data any) (SerializedObject, E.NestedError) {
|
||||
if jsonTag == "-" {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
// If the json tag is not empty, use it as the key
|
||||
switch {
|
||||
|
||||
Reference in New Issue
Block a user