Socket
Book a DemoInstallSign in
Socket

modernc.org/uncomment

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modernc.org/uncomment

Go Modules
Version
v0.1.7
Version published
Created
Source

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 exported 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.

FAQs

Package last updated on 21 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts