Documentation
¶
Overview ¶
Package nocomment removes line and block comments from the provided bytes.
Line comments start with either // or # and end when an EOL is encountered. What to accept as line comments is configurable.
Block comments start with /* and end with */ and can span lines.
Anything within quotes, "", is ignored.
Index ¶
Constants ¶
View Source
const ( // C++ style comments CPPComment commentType // shell style comments ShellComment // C style comments CComment )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stripper ¶
type Stripper struct {
// KeepCComments: do not elide C style comments (/* */).
KeepCComments bool
// KeepCPPComments: do not elide C++ style comments (//).
KeepCPPComments bool
// KeepShellComments: do not elide C style comments (#).
KeepShellComments bool
}
Stripper handles the elision of comments from text. The style of comments to elide is configurable: all supported styles are elided by default.
Click to show internal directories.
Click to hide internal directories.
