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