improved health check

This commit is contained in:
yusing
2024-10-14 10:02:53 +08:00
parent 99207ae606
commit f38b3abdbc
20 changed files with 323 additions and 155 deletions

View File

@@ -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 {