1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
package heredoc_test
import (
"fmt"
"github.com/MakeNowJust/heredoc/v2"
)
func ExampleDoc_lipsum() {
fmt.Print(heredoc.Doc(`
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, ...
`))
}
func ExampleDoc_spec() {
fmt.Println(heredoc.Doc(`It is single line.`))
fmt.Println(heredoc.Doc(`
It is first line.
It is second line.`))
fmt.Println(heredoc.Doc(`
Next is last line.
`))
fmt.Println("Previous is last line.")
}
func ExampleDocf() {
libName := "github.com/MakeNowJust/heredoc"
author := "TSUYUSATO Kitsune (@MakeNowJust)"
fmt.Print(heredoc.Docf(`
Library Name : %s
Author : %s
Repository URL: http://%s.git
`, libName, author, libName))
}
|