docparser

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDocLines

func ParseDocLines(rawdoc string, repl map[string]string) []string

ParseDocLines reads the rawdoc got from go/doc parsing, adds a leading "// " to each line, applies the replacements, and returns a slice of strings for each line. The result can then be conveniently used in a go template.

Example:

ParseDocLines(
	"myFunc does this.\nIt is cool.\n",
	map[string]string{"myFunc": "MyFunc", "cool": "nice"}
)

// Output
[]string{
	"// MyFunc does this.",
	"// It is nice.",
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL