hereduck is a heredoc library for Go.
go get crdx.org/hereduck
import "crdx.org/hereduck"
func main() {
doc = hereduck.D(`
Hello
world
`)
}
This would result in the following string in doc
, including the trailing new line.
Hello
world
The minimum indentation level shared by all lines is stripped out, but subsequent indentation is preserved.
There is also hereduck.Df
which follows the standard formatting string pattern.
Open an issue or send a pull request.