You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the XML file is parsed by the Unmarshal function, restoring it using Marshal loses the original annotation content。
When dealing with some complex XML configuration files, the annotation information of corresponding fields is often very useful. Would you consider restoring the file annotation information during restoration?
example:
user.xml
<!-- Field content comment......-->
<user name="common">
.....
xml.go
if err = xml.Unmarshal(userXMLFile, &user); err != nil {
panic(err)
}
// Update of some field values...
context, err := xml.Marshal(&user)
if err != nil {
panic(err)
}
// Output:
// <!-- Field content comment......-->
// <user name="new_username">
// .....
The text was updated successfully, but these errors were encountered:
When the XML file is parsed by the Unmarshal function, restoring it using Marshal loses the original annotation content。
When dealing with some complex XML configuration files, the annotation information of corresponding fields is often very useful. Would you consider restoring the file annotation information during restoration?
example:
The text was updated successfully, but these errors were encountered: