Re:Show HN: Gojay – Performant JSON encoder/decoder for Golang
by dullgiulio on Sunday May 20, 2018 @01:56PM
(#17113958)
Unused imports are definitely not an unsolved problem: as last step after dumbly generating code, run goimports.
Re:Show HN: Gojay – Performant JSON encoder/decoder for Golang
by Vendan on Sunday May 20, 2018 @02:19PM
(#17114063)
Never said "unsolved", I said "annoyance". And I tend to write the code to figure it out and do the right thing. My annoyance is with code gens that do https://github.com/golang/protobuf/blob/master/protoc-gen-go.... Not even goimports will strip those...
One very nice feature of go is that the formatter is available as a library (https://golang.org/pkg/go/format/#Source), so you can gen "raw" code and then throw it through the formatter to get nice pretty output.