Skip to content

Commit 284c0c5

Browse files
authored
docs(list): fix list examples in godoc (#404)
1 parent d858132 commit 284c0c5

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

list/enumerator.go

+31-25
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import (
1616
// }
1717
//
1818
// 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
2424
//
2525
// Or, define your own.
2626
type Enumerator func(items Items, index int) string
@@ -43,10 +43,11 @@ type Indenter func(items Items, index int) string
4343

4444
// Alphabet is the enumeration for alphabetical listing.
4545
//
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.
5051
func Alphabet(_ Items, i int) string {
5152
if i >= abcLen*abcLen+abcLen {
5253
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
6162

6263
// Arabic is the enumeration for arabic numerals listing.
6364
//
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.
6870
func Arabic(_ Items, i int) string {
6971
return fmt.Sprintf("%d.", i+1)
7072
}
7173

7274
// Roman is the enumeration for roman numerals listing.
7375
//
76+
// Example:
7477
// I. Foo
7578
// II. Bar
7679
// III. Baz
@@ -93,30 +96,33 @@ func Roman(_ Items, i int) string {
9396

9497
// Bullet is the enumeration for bullet listing.
9598
//
96-
// • Foo
97-
// • Bar
98-
// • Baz
99-
// • Qux.
99+
// Example:
100+
// • Foo
101+
// • Bar
102+
// • Baz
103+
// • Qux.
100104
func Bullet(Items, int) string {
101105
return "•"
102106
}
103107

104108
// Asterisk is an enumeration using asterisks.
105109
//
106-
// * Foo
107-
// * Bar
108-
// * Baz
109-
// * Qux.
110+
// Example:
111+
// * Foo
112+
// * Bar
113+
// * Baz
114+
// * Qux.
110115
func Asterisk(Items, int) string {
111116
return "*"
112117
}
113118

114119
// Dash is an enumeration using dashes.
115120
//
116-
// - Foo
117-
// - Bar
118-
// - Baz
119-
// - Qux.
121+
// Example:
122+
// - Foo
123+
// - Bar
124+
// - Baz
125+
// - Qux.
120126
func Dash(Items, int) string {
121127
return "-"
122128
}

0 commit comments

Comments
 (0)