Skip to content

Is there any reason for reqxml? why not BodyXML and ToXML? #102

Closed Answered by earthboundkid
raeperd asked this question in Support
Discussion options

You must be logged in to vote

Thank you for your kind words!

I did some testing during development, and if it were requests.BodyXML (or Builder.BodyXML) then everyone who imports requests would also include the xml package in their final binary, even if they don't use XML at all in their application. I was hoping the compiler's dead code analysis would remove it, but experimentally, that didn't seem to be true. It's not a big impact and it is a standard library package, so it's not huge deal, but it did seem unfortunate to add bloat to everyone even if people aren't using it.

The flip side of this is that everyone is stuck importing encoding/json and golang.org/x/net/html now, even if you don't use JSON in your app. J…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@raeperd
Comment options

Answer selected by earthboundkid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants