Re: [go-nuts] gofmt 1.19 reformats comments in a way which breaks go-swagger

2022-08-17 Thread crod...@gmail.com
I think the parsing rules for go-swagger are described here: https://goswagger.io/use/spec.html#parsing-rules It looks like this issue has affected other codebases such as Cockroachdb: https://github.com/cockroachdb/cockroach/pull/86049#issuecomment-1213573808 — Craig On Wednesday, August 17,

[go-nuts] gofmt 1.19 reformats comments in a way which breaks go-swagger

2022-08-17 Thread crod...@gmail.com
Hi, I have a codebase which uses go-swagger to parse comments in Go files and generate swagger documentation. I recently upgraded to Go 1.19, and found that gofmt’s behavior formats comments in a way which breaks go-swagger. For example this code: p

[go-nuts] Removing example usage of init() from pkg.Flag docs page?

2022-01-26 Thread crod...@gmail.com
On this page: https://pkg.go.dev/flag There is an example: var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") } I understand that this is only an example, but there is no real need to use an init() function when using the flag package. When I fi