@@ -16,11 +16,11 @@ import (
16
16
// }
17
17
//
18
18
// There are several predefined enumerators:
19
- // • Alphabet
20
- // • Arabic
21
- // • Bullet
22
- // • Dash
23
- // • Roman
19
+ // - Alphabet
20
+ // - Arabic
21
+ // - Bullet
22
+ // - Dash
23
+ // - Roman
24
24
//
25
25
// Or, define your own.
26
26
type Enumerator func (items Items , index int ) string
@@ -43,10 +43,11 @@ type Indenter func(items Items, index int) string
43
43
44
44
// Alphabet is the enumeration for alphabetical listing.
45
45
//
46
- // a. Foo
47
- // b. Bar
48
- // c. Baz
49
- // d. Qux.
46
+ // Example:
47
+ // a. Foo
48
+ // b. Bar
49
+ // c. Baz
50
+ // d. Qux.
50
51
func Alphabet (_ Items , i int ) string {
51
52
if i >= abcLen * abcLen + abcLen {
52
53
return fmt .Sprintf ("%c%c%c." , 'A' + i / abcLen / abcLen - 1 , 'A' + (i / abcLen )% abcLen - 1 , 'A' + i % abcLen )
@@ -61,16 +62,18 @@ const abcLen = 26
61
62
62
63
// Arabic is the enumeration for arabic numerals listing.
63
64
//
64
- // 1. Foo
65
- // 2. Bar
66
- // 3. Baz
67
- // 4. Qux.
65
+ // Example:
66
+ // 1. Foo
67
+ // 2. Bar
68
+ // 3. Baz
69
+ // 4. Qux.
68
70
func Arabic (_ Items , i int ) string {
69
71
return fmt .Sprintf ("%d." , i + 1 )
70
72
}
71
73
72
74
// Roman is the enumeration for roman numerals listing.
73
75
//
76
+ // Example:
74
77
// I. Foo
75
78
// II. Bar
76
79
// III. Baz
@@ -93,30 +96,33 @@ func Roman(_ Items, i int) string {
93
96
94
97
// Bullet is the enumeration for bullet listing.
95
98
//
96
- // • Foo
97
- // • Bar
98
- // • Baz
99
- // • Qux.
99
+ // Example:
100
+ // • Foo
101
+ // • Bar
102
+ // • Baz
103
+ // • Qux.
100
104
func Bullet (Items , int ) string {
101
105
return "•"
102
106
}
103
107
104
108
// Asterisk is an enumeration using asterisks.
105
109
//
106
- // * Foo
107
- // * Bar
108
- // * Baz
109
- // * Qux.
110
+ // Example:
111
+ // * Foo
112
+ // * Bar
113
+ // * Baz
114
+ // * Qux.
110
115
func Asterisk (Items , int ) string {
111
116
return "*"
112
117
}
113
118
114
119
// Dash is an enumeration using dashes.
115
120
//
116
- // - Foo
117
- // - Bar
118
- // - Baz
119
- // - Qux.
121
+ // Example:
122
+ // - Foo
123
+ // - Bar
124
+ // - Baz
125
+ // - Qux.
120
126
func Dash (Items , int ) string {
121
127
return "-"
122
128
}
0 commit comments