jennifer
jennifer copied to clipboard
Jennifer is a code generator for Go
Give user ability to provide custom imports sorter function. https://github.com/dave/jennifer/blob/be82eb6738040b1b5934f0c463273c37d5fd5fd9/jen/jen.go#L132 Also it would be nice to have ability to put empty lines to achieve imports like this: ```go import (...
Functions like `StructFunc` take a `Group` but don't return an error. I have conditions where iterating and creating the fields must error out. Right now i'm jumping through hoop to...
I am trying to generate a multi-line call chain but go requires the newline between the Dot and the Id, such as: ```go cfg := NewConfigBuilder(). WithValue("k", "v"). WithValue("a", "b")....
Currently if generated code is not valid and fmt returns error, invalid code is written to stderr, so there should be additional steps executed to understand the problem - like...
What do you think of reporting this useful tool in the README? https://github.com/aloder/tojen
A pkg.go.dev badge/hyperlink would be useful when trying to access the documentation on pkg.go.dev.
Code generated by the following (semi-pseudo) example does not compile: ``` code := jen.NewFilePathName("path/to/pkg", "pkg_test") code.ImportName("path/to/pkg", "pkg") code.Qual("path/to/pkg", "MyStruct") ``` The problem is that the generated code in `pkg_test` will...
If the import alias is invalid or has been registered already, jennifer make it unique by appending a number. This led to an ugly generated code with imports block, for...
Various linting tools will throw an error if an anonymous import isn't documented with a comment. Something like: ```go import ( "fmt" "log" // Import the MySQL driver for database/sql....
for example ``` type struct A{ } func (c *A) Method(){ // balabala } ```