Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To summarize the issue, running `swag fmt` will set (at least) 2 spaces between the attribute tag and the rest of the comment. But this is a problem for struct with single comment: ```diff type Example struct { Foobar string -} // @name Example +} // @name Example ``` Indeed the doc generation doesn't interpret this correctly for struct (it completely ignore it). So there are 2 solutions: - fix the indent (which is feel more natural) - fix the doc generation to correctly parse 2 spaces This commit is fixing the indent part. Basically I just set the padding=1 on `tabwriter`. The cons is that it will also impacts all other godocs. For instance (taken from the readme): ```diff -// @title Swagger Example API -// @Version 1.0 -// @description This is a sample server celler server. -// @termsofservice http://swagger.io/terms/ +// @title Swagger Example API +// @Version 1.0 +// @description This is a sample server celler server. +// @termsofservice http://swagger.io/terms/ ```
- Loading branch information