Documentation
¶
Overview ¶
Package here provides creation of here-documents from raw strings.
Golang supports raw-string syntax.
doc := ` Foo Bar `
But raw-string cannot recognize indentation. Thus such content is an indented string, equivalent to
"\n\tFoo\n\tBar\n"
This doesn't look good when incorporating texts into markdown or other formats.
`here` solves this problem by removing unnecessary indentation based on the minimum indentation detected:
doc := here.Doc(` Foo Bar `)
Is equivalent to
"Foo\nBar\n"
Given that the backtick in Go cannot be re-used in blocks, `here` will automatically replace all tildes (~) with backticks (`), unless escaped.
"This is a ~code~ example with \~ tildes"
Will be converted to:
"This is a `code` example with ~ tildes"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.