There’s some intelligence that’s built into the package as well, which I usually appreciate. Very recently I was doing a PR review, and we had a developer who was creating a struct and providing the JSON annotation next to the fields, but there was no inbound/incoming data to unmarshal into… So in that case, I’m like, well, unless you really anticipate that the data that you’re pushing out, that basically the field names are gonna be different from what they are named in the struct itself, you don’t really need to annotate your fields for your structs. The json package is gonna follow your lead, as you say, Daniel; it’s gonna basically look at the name you’ve given your fields, and actually use those names in the JSON output. So you don’t have to add that annotation there. So there’s a lot of smart fun that I can certain appreciate that’s built into the package, and this is something that we’re gonna get more into, as well…
I like the standard library, I like using the standard library, because – maybe it’s the nature of my work, but I tend to not look for third-party packages to do certain things if I can find something in the standard library, even if it’s a little harder to deal with, or a little less performant, or whatever the case may be. If you’ve been in the community for any length of time, you’ve probably come across other community-built/third-party packages that have made their own trade-offs with regards to the implentation for JSON parsing, and marshaling and unmarshaling, and all that stuff… And a lot of them seem to be focused around speed, and performance.
Again, Dave Cheney’s own experimentation, which is published, and hopefully – I wish he was here to discuss it, but there’s that sort of… I’m curious to understand when is a good reason to deviate from, say, the standard library’s approach. Everybody wants fast, right? “Oh, it’s faster. I should use that.” Well, there are trade-offs there, too. You don’t pick it just because it’s faster… But I’m curious your take as to why pick one over the other, what sort of trade-offs you’re making along those lines.