swag icon indicating copy to clipboard operation
swag copied to clipboard

Exclude comments from generated documentation

Open bdw-nobl9 opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe. Marking comments to exclude from documentation would be very helpful. It's partially working: While using swag I observed that if I put comment at the end of the line while having comment in line above - this first comment is visible in generated docs but comment at the end of the line isn't. If I remove first comment - second one became visible.

Describe the solution you'd like Possibility to exclude comments - for example like in go-doc (//line).

Describe alternatives you've considered Other (not conflicting with go-doc's //line) way of marking comments to exclude.

Additional context

// (1) Always visible comment
Description     string       `json:"description"` // (2) Comment excluded only if (1) is added.
Name            string       `json:"name"`

I've discovered this behavior by testing possibilities for having excluded comments. I think something like

//line (1) Comment excluded because '//line' is added (no need to add comment at the end of the line)
Description     string       `json:"description"`
Name            string       `json:"name"`

Would be simpler.

bdw-nobl9 avatar Nov 30 '20 10:11 bdw-nobl9

same with #243, PR is welcome

sdghchj avatar Dec 03 '20 06:12 sdghchj

same with #243, PR is welcome

Same issue for me

nxj-hsadhvani avatar Apr 02 '21 02:04 nxj-hsadhvani

Same issue for me

biexiang avatar Jul 13 '22 10:07 biexiang