type PolicySpec struct {
Description string `json:"description" yaml:"description"`
EndpointSelector Selector `json:"endpointSelector,omitempty" yaml:"ingress,omitempty"`
Severity int `json:"severity,omitempty" yaml:"severity,omitempty"`
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
Message string `json:"message,omitempty" yaml:"message,omitempty"`
Process KubeArmorSys `json:"process,omitempty" yaml:"process,omitempty"`
File KubeArmorSys `json:"file,omitempty" yaml:"network,omitempty"`
Action string `json:"action,omitempty" yaml:"action,omitempty"`
}
我即使在字段中添加了 omitempty 却在 yaml 和 json 中获得了空结构,如何从 api 响应正文中删除那些空结构?