Documentation ¶
Overview ¶
Package comments extracts and parses comments from a package.
Index ¶
Constants ¶
const DefaultMarkerPrefix = "+"
DefaultMarkerPrefix that is commonly used by comment markers.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comments ¶
type Comments struct {
// contains filtered or unexported fields
}
Comments for a particular package.
type Markers ¶
Markers are comments that begin with a special character (typically DefaultMarkerPrefix). Comment markers that contain '=' are considered to be key=value pairs, represented as one map key with a slice of multiple values.
func ParseMarkers ¶
ParseMarkers parses comment markers from the supplied comment using the DefaultMarkerPrefix.
func ParseMarkersWithPrefix ¶
ParseMarkersWithPrefix parses comment markers from the supplied comment. Any line that begins with the supplied prefix is considered a comment marker. For example using marker prefix '+' the following comments:
+key:value1 +key:value2
Would be parsed as Markers{"key": []string{"value1", "value2"}}