uncomment command - modernc.org/uncomment - Go Packages
source link: https://pkg.go.dev/modernc.org/uncomment
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README ¶
uncomment
Command uncomment removes comments from Go source files.
Installation
To install/update:
$ go install modernc.org/uncomment@latest
Verbose output
Add -v to turn on progress tracing and printing out totals.
Keeping godoc comments
Add -keep-godoc to keep comments of top level declarations.
Formatting output
Add -gofmt to format the output files.
Example
To remove non-godoc comments in a set of specific files and format the result:
uncomment -keep-godoc -gofmt lib/sqlite*.go libtest/sqlite*.go
Notes
Input files are overwritten without asking. Be sure to have a backup of your files before using uncomment.
Passing no non-flag arguments equals to passing *.go.
Package comments are not touched.
The parser used by uncomment does not yet handle some generic constructs.
Documentation ¶
Overview ¶
Command uncomment removes comments from Go source files.
Installation ¶
To install/update:
$ go install modernc.org/uncomment@latest
Verbose output ¶
Add -v to turn on progress tracing and printing out totals.
Keeping godoc comments ¶
Add -keep-godoc to keep comments of top level declarations.
Formatting output ¶
Add -gofmt to format the output files.
Example ¶
To remove non-godoc comments in a set of specific files and format the result:
uncomment -keep-godoc -gofmt lib/sqlite*.go libtest/sqlite*.go
Notes ¶
Input files are overwritten without asking. Be sure to have a backup of your files before using uncomment.
Package comments are not touched.
Bugs ¶
The parser used by uncomment does not yet handle some generic constructs.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK