4 ms·
Advanced Encoding and Decoding Techniques in Go
- themihai 10y agoThe tutorial makes it seem more complicated than it actually is. JSONDog and the constructor example has no place there.
- joncalhoun 10y agoWhich specific example do you mean, and do you have any suggestions on how to improve it? I felt this was a good approach given how aliasing builds off of it, but I may have missed a better approach. These are just ones that have worked well for me.
- transitorykris 10y agoI believe grandparent may be referring to the first example. It's a fair bit of reading to get to the good stuff, and if you're skimming it can look complicated. Personally I think the approach of building up the solution is instructive.
- jzelinskie 10y agoIs this advanced? If you have ever or will ever attempt to implement an idiomatic encoder/decoder in Go, you will learn everything this post talks about.
- joncalhoun 10y agoIt is a relative term. I use it here because most introductory posts about encoding/decoding in go (like https://blog.golang.org/json-and-go https://blog.golang.org/json-and-go) don't touch on these at all. Instead many people figure each of these out separately over time.
- laumars 10y agoI'm inclined to agree with the grandparent here. It's good that you're willing to contribute to the already impressive catalogue of Go reference material but your guide is really more of an introduction into the JSON marshaller than advanced techniques about encoding and decoding in the more general sense. Sadly I do feel a little mislead by the title since I was hoping for something a little more challenging than JSON - though had I known it was just JSON I certainly wouldn't have opened the page so maybe the title works? ;) On a positive note, it does look like it's well written. Detailed with clear examples and laid out in a clean design that's easy to follow.