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
My issue isn't already found on the issue tracker.
I have replicated my issue using the latest version of the library and it is still present.
cloudflare-go version
0.75
Go environment
N/A
Expected output
Previously, the Go interface will keep the original comments because of omitempty. It's not ideal because there's no easy way to clear comments, where an empty string will keep the original comment because omitempty will omit empty strings. The API has since then changed to clear comments when an empty string is used, and the Go library was updated, but then one cannot easily keep the current comments. I believe the expected behavior of Update with zero values is to keep everything, and using strings cannot distinguish the two important cases: (1) keep the current comment and (2) clear the current comment.
Suggested solution: use *string for the Comment field and add back omitempty.
Actual output
See above
Code demonstrating the issue
// This will clear the commentsc.UpdateDNSRecord(ctx, ZoneIdentifier(zone), UpdateDNSRecordParams{
ID: id,
Content: ip,
}
)
Confirmation
cloudflare-go version
0.75
Go environment
N/A
Expected output
Previously, the Go interface will keep the original comments because of
omitempty
. It's not ideal because there's no easy way to clear comments, where an empty string will keep the original comment becauseomitempty
will omit empty strings. The API has since then changed to clear comments when an empty string is used, and the Go library was updated, but then one cannot easily keep the current comments. I believe the expected behavior ofUpdate
with zero values is to keep everything, and using strings cannot distinguish the two important cases: (1) keep the current comment and (2) clear the current comment.Suggested solution: use
*string
for theComment
field and add backomitempty
.Actual output
See above
Code demonstrating the issue
Steps to reproduce
See above
References
The text was updated successfully, but these errors were encountered: