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 <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Shulhan 2024-12-30 17:10:57 +07:00 committed by Gopher Robot
parent 5efb4239c6
commit 856a7bc8e9

View file

@ -162,12 +162,12 @@ func delete(m map[Type]Type1, key Type)
// The len built-in function returns the length of v, according to its type: // The len built-in function returns the length of v, according to its type:
// //
// Array: the number of elements in v. // - Array: the number of elements in v.
// Pointer to array: the number of elements in *v (even if v is nil). // - Pointer to array: the number of elements in *v (even if v is nil).
// Slice, or map: the number of elements in v; if v is nil, len(v) is zero. // - Slice, or map: the number of elements in v; if v is nil, len(v) is zero.
// String: the number of bytes in v. // - String: the number of bytes in v.
// Channel: the number of elements queued (unread) in the channel buffer; // - Channel: the number of elements queued (unread) in the channel buffer;
// if v is nil, len(v) is zero. // if v is nil, len(v) is zero.
// //
// For some arguments, such as a string literal or a simple array expression, the // For some arguments, such as a string literal or a simple array expression, the
// result can be a constant. See the Go language specification's "Length and // result can be a constant. See the Go language specification's "Length and
@ -176,12 +176,12 @@ func len(v Type) int
// The cap built-in function returns the capacity of v, according to its type: // The cap built-in function returns the capacity of v, according to its type:
// //
// Array: the number of elements in v (same as len(v)). // - Array: the number of elements in v (same as len(v)).
// Pointer to array: the number of elements in *v (same as len(v)). // - Pointer to array: the number of elements in *v (same as len(v)).
// Slice: the maximum length the slice can reach when resliced; // - Slice: the maximum length the slice can reach when resliced;
// if v is nil, cap(v) is zero. // if v is nil, cap(v) is zero.
// Channel: the channel buffer capacity, in units of elements; // - Channel: the channel buffer capacity, in units of elements;
// if v is nil, cap(v) is zero. // if v is nil, cap(v) is zero.
// //
// For some arguments, such as a simple array expression, the result can be a // For some arguments, such as a simple array expression, the result can be a
// constant. See the Go language specification's "Length and capacity" section for // constant. See the Go language specification's "Length and capacity" section for
@ -194,18 +194,18 @@ func cap(v Type) int
// argument, not a pointer to it. The specification of the result depends on // argument, not a pointer to it. The specification of the result depends on
// the type: // the type:
// //
// Slice: The size specifies the length. The capacity of the slice is // - Slice: The size specifies the length. The capacity of the slice is
// equal to its length. A second integer argument may be provided to // equal to its length. A second integer argument may be provided to
// specify a different capacity; it must be no smaller than the // specify a different capacity; it must be no smaller than the
// length. For example, make([]int, 0, 10) allocates an underlying array // length. For example, make([]int, 0, 10) allocates an underlying array
// of size 10 and returns a slice of length 0 and capacity 10 that is // of size 10 and returns a slice of length 0 and capacity 10 that is
// backed by this underlying array. // backed by this underlying array.
// Map: An empty map is allocated with enough space to hold the // - Map: An empty map is allocated with enough space to hold the
// specified number of elements. The size may be omitted, in which case // specified number of elements. The size may be omitted, in which case
// a small starting size is allocated. // a small starting size is allocated.
// Channel: The channel's buffer is initialized with the specified // - Channel: The channel's buffer is initialized with the specified
// buffer capacity. If zero, or the size is omitted, the channel is // buffer capacity. If zero, or the size is omitted, the channel is
// unbuffered. // unbuffered.
func make(t Type, size ...IntegerType) Type func make(t Type, size ...IntegerType) Type
// The max built-in function returns the largest value of a fixed number of // The max built-in function returns the largest value of a fixed number of