您可以将该结构添加到您定义的结构中。然后添加功能
MarshalJSON,并
UnmarshalYAML给你的结构:
type YourStruct struct { importedStruct}func (s *YourStruct) MarshalJSON() ([]byte, error) { ...}
您可以将该结构添加到您定义的结构中。然后添加功能
MarshalJSON,并
UnmarshalYAML给你的结构:
type YourStruct struct { importedStruct}func (s *YourStruct) MarshalJSON() ([]byte, error) { ...}