Which 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.
I 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.
Is 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.
I use it here because most introductory posts about encoding/decoding in go (like 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.
I'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.
6 comments
[ 3.8 ms ] story [ 24.8 ms ] threadI 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.
I use it here because most introductory posts about encoding/decoding in go (like 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.
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.