1 package main
2
3 import "fmt"
4
5 func main() {
6 « fmt.Println("Start")
7 x := 42
8 »
9
10 « y := 0
11 fmt.Println("After comment")
12 »
13
14
15
16
17 « fmt.Println("After multiple comments")
18 »
19
20
21 « fmt.Println("After block comment")
22 z := 0
23 »
24 «if x > 0 {»
25 « y = x * 2
26 » } else {
27 « y = x - 2
28 » }
29
30 « z = 5
31 »
32
35
36 « z1 := 0
37 »
38 « z1 = 1 z1 = 2
41 »
42 « z1 = 3; z1 = 4
43 »
44 « z1 = 5 z1 = 6
47 »
48 z1 = 7
51
52 « z1 = 8 z1 = 9
55 »
56 « z1 = 10
57 z1 = 10
58 z1 = 10
59 »
60 « fmt.Printf("Result: %d\n", z)
61 fmt.Printf("Result: %d\n", z1)
62 »
63 « s := `This is a multi-line raw string
64 // fake comment on line 2
65 /* and fake comment on line 3 */
66 and other`
67 »
68 « s = `another multiline string
69 `
70 »
71 « fmt.Printf("%s", s)
72 »
73
74
75
76
77
78 « fmt.Printf("Result: %d\n", y)»
79
80 }
81
82 func empty() {
83
84 }
85
86 func singleBlock() {
87 « fmt.Printf("ResultSomething")
88 »}
89
90 func justComment() {
91
92 }
93
94 func justMultilineComment() {
95
98 }
99
100 func constBlock() {
101 « const (
102 A = 1
103
104 B = 2
105 )
106 fmt.Printf("A=%d B=%d", A, B)
107 »}
108
109 func compositeLit() {
110 « m := map[string]int{
111 "a": 1,
112 » }
113 « fmt.Println(m)
114 »}
115
View as plain text