This is heavily based on stringer, a code generation library from the Golang team. Large parts of this code are lifted directly from stringer. I don't really like how it's structured, but they did it first :seedling: It's possible that there are better ways to do some of the AST manipulation I'm doing, using either go/types or go/printer, e.g. https://godoc.org/golang.org/x/tools/go/types#Info.TypeOf
This is heavily based on stringer, a code generation library from the Golang team. Large parts of this code are lifted directly from stringer. I don't really like how it's structured, but they did it first :seedling: It's possible that there are better ways to do some of the AST manipulation I'm doing, using either go/types or go/printer, e.g. https://godoc.org/golang.org/x/tools/go/types#Info.TypeOf