quicktype
quicktype copied to clipboard
Go: prepend struct field comment (support GoDoc)
This makes the Go generator prepend struct field comments, so instead of:
type Bar struct {
Foo string `json:"foo"` // this bar's foo
}
...we get:
type Bar struct {
// this bar's foo
Foo string `json:"foo"`
}
...which GoDoc supports and documents accordingly.
Bump for this to get merged..
@cv thank you! There is a small build error.
Including the comments in the column formatting produces code that gofmt does not like:
gofmt does:
@dvdsgl is the expectation that the code generated by the tool passes gofmt without change?
In some of our projects that involve Go code generation we've been successful so far with letting the generator make a bit of a mess, then let gofmt clean everything up later.