Black Friday Sale!
Save 50% on Web Development with Go and Test with Go until Dec 3.
Both courses have lifetime access, a 30-day money back guarantee, and free updates. This is also the biggest discount I offer on the courses, and I only do it once a year around Black Friday.
Thank you for your continued support and happy coding!
Jon Calhoun
I want to describe a scenario where there currently isn’t a good solution in Go (at least that I am aware of). Let’s say you have something like the template.Template type with methods like Template.Funcs: type Template struct { *parse.Tree // contains filtered or unexported fields } func (t *Template) Funcs(funcMap FuncMap) *Template If we wanted to use an interface for this type, it is impossible to express in Go now.
There has been a lot of talk about generics lately in the Go community which as lead to me thinking about them a lot lately. In thinking about generics, my mind instinctively wandered to code generation because that has been my go-to tool when I do need something resembling a generic. In fact, I have written about using code generation to get by without generics in Go in the past.
Learn how to use code generation to create type-safe code (like a Queue or LinkedList) without having to rewrite the same thing over and over again.
Jon Calhoun is a full stack web developer who teaches about Go, web development, algorithms, and anything programming. If you haven't already, you should totally check out his Go courses.
Previously, Jon worked at several statups including co-founding EasyPost, a shipping API used by several fortune 500 companies. Prior to that Jon worked at Google, competed at world finals in programming competitions, and has been programming since he was a child.
©2018 Jonathan Calhoun. All rights reserved.