Skip to content

Commit 856a7bc

Browse files
shuLhangopherbot
authored andcommitted
builtin: use list instead of indentation for comments in cap, len, and make
Using list make the document more readable in HTML and CLI. Change-Id: Ib84c84656f32806e8612b1ca13938d93f618e27f Reviewed-on: https://go-review.googlesource.com/c/go/+/639315 Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
1 parent 5efb423 commit 856a7bc

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/builtin/builtin.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ func delete(m map[Type]Type1, key Type)
162162

163163
// The len built-in function returns the length of v, according to its type:
164164
//
165-
// Array: the number of elements in v.
166-
// Pointer to array: the number of elements in *v (even if v is nil).
167-
// Slice, or map: the number of elements in v; if v is nil, len(v) is zero.
168-
// String: the number of bytes in v.
169-
// Channel: the number of elements queued (unread) in the channel buffer;
170-
// if v is nil, len(v) is zero.
165+
// - Array: the number of elements in v.
166+
// - Pointer to array: the number of elements in *v (even if v is nil).
167+
// - Slice, or map: the number of elements in v; if v is nil, len(v) is zero.
168+
// - String: the number of bytes in v.
169+
// - Channel: the number of elements queued (unread) in the channel buffer;
170+
// if v is nil, len(v) is zero.
171171
//
172172
// For some arguments, such as a string literal or a simple array expression, the
173173
// result can be a constant. See the Go language specification's "Length and
@@ -176,12 +176,12 @@ func len(v Type) int
176176

177177
// The cap built-in function returns the capacity of v, according to its type:
178178
//
179-
// Array: the number of elements in v (same as len(v)).
180-
// Pointer to array: the number of elements in *v (same as len(v)).
181-
// Slice: the maximum length the slice can reach when resliced;
182-
// if v is nil, cap(v) is zero.
183-
// Channel: the channel buffer capacity, in units of elements;
184-
// if v is nil, cap(v) is zero.
179+
// - Array: the number of elements in v (same as len(v)).
180+
// - Pointer to array: the number of elements in *v (same as len(v)).
181+
// - Slice: the maximum length the slice can reach when resliced;
182+
// if v is nil, cap(v) is zero.
183+
// - Channel: the channel buffer capacity, in units of elements;
184+
// if v is nil, cap(v) is zero.
185185
//
186186
// For some arguments, such as a simple array expression, the result can be a
187187
// constant. See the Go language specification's "Length and capacity" section for
@@ -194,18 +194,18 @@ func cap(v Type) int
194194
// argument, not a pointer to it. The specification of the result depends on
195195
// the type:
196196
//
197-
// Slice: The size specifies the length. The capacity of the slice is
198-
// equal to its length. A second integer argument may be provided to
199-
// specify a different capacity; it must be no smaller than the
200-
// length. For example, make([]int, 0, 10) allocates an underlying array
201-
// of size 10 and returns a slice of length 0 and capacity 10 that is
202-
// backed by this underlying array.
203-
// Map: An empty map is allocated with enough space to hold the
204-
// specified number of elements. The size may be omitted, in which case
205-
// a small starting size is allocated.
206-
// Channel: The channel's buffer is initialized with the specified
207-
// buffer capacity. If zero, or the size is omitted, the channel is
208-
// unbuffered.
197+
// - Slice: The size specifies the length. The capacity of the slice is
198+
// equal to its length. A second integer argument may be provided to
199+
// specify a different capacity; it must be no smaller than the
200+
// length. For example, make([]int, 0, 10) allocates an underlying array
201+
// of size 10 and returns a slice of length 0 and capacity 10 that is
202+
// backed by this underlying array.
203+
// - Map: An empty map is allocated with enough space to hold the
204+
// specified number of elements. The size may be omitted, in which case
205+
// a small starting size is allocated.
206+
// - Channel: The channel's buffer is initialized with the specified
207+
// buffer capacity. If zero, or the size is omitted, the channel is
208+
// unbuffered.
209209
func make(t Type, size ...IntegerType) Type
210210

211211
// The max built-in function returns the largest value of a fixed number of

0 commit comments

Comments
 (0)