]> Cypherpunks repositories - gostls13.git/commitdiff
builtin: use list instead of indentation for comments in cap, len, and make
authorShulhan <m.shulhan@gmail.com>
Mon, 30 Dec 2024 10:10:57 +0000 (17:10 +0700)
committerGopher Robot <gobot@golang.org>
Mon, 30 Dec 2024 23:59:23 +0000 (15:59 -0800)
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>

src/builtin/builtin.go

index af01aea5dd79f4713cbdf52d3d03c5ff629b5380..afa2a10f9091dcaac193fd1cf68566867584468a 100644 (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:
 //
-//     Array: the number of elements in v.
-//     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.
-//     String: the number of bytes in v.
-//     Channel: the number of elements queued (unread) in the channel buffer;
-//              if v is nil, len(v) is zero.
+//   - Array: the number of elements in v.
+//   - 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.
+//   - String: the number of bytes in v.
+//   - Channel: the number of elements queued (unread) in the channel buffer;
+//     if v is nil, len(v) is zero.
 //
 // 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
@@ -176,12 +176,12 @@ func len(v Type) int
 
 // 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)).
-//     Pointer to array: the number of elements in *v (same as len(v)).
-//     Slice: the maximum length the slice can reach when resliced;
-//     if v is nil, cap(v) is zero.
-//     Channel: the channel buffer capacity, in units of elements;
-//     if v is nil, cap(v) is zero.
+//   - 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;
+//     if v is nil, cap(v) is zero.
+//   - Channel: the channel buffer capacity, in units of elements;
+//     if v is nil, cap(v) is zero.
 //
 // 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
@@ -194,18 +194,18 @@ func cap(v Type) int
 // argument, not a pointer to it. The specification of the result depends on
 // the type:
 //
-//     Slice: The size specifies the length. The capacity of the slice is
-//     equal to its length. A second integer argument may be provided to
-//     specify a different capacity; it must be no smaller than the
-//     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
-//     backed by this underlying array.
-//     Map: An empty map is allocated with enough space to hold the
-//     specified number of elements. The size may be omitted, in which case
-//     a small starting size is allocated.
-//     Channel: The channel's buffer is initialized with the specified
-//     buffer capacity. If zero, or the size is omitted, the channel is
-//     unbuffered.
+//   - Slice: The size specifies the length. The capacity of the slice is
+//     equal to its length. A second integer argument may be provided to
+//     specify a different capacity; it must be no smaller than the
+//     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
+//     backed by this underlying array.
+//   - Map: An empty map is allocated with enough space to hold the
+//     specified number of elements. The size may be omitted, in which case
+//     a small starting size is allocated.
+//   - Channel: The channel's buffer is initialized with the specified
+//     buffer capacity. If zero, or the size is omitted, the channel is
+//     unbuffered.
 func make(t Type, size ...IntegerType) Type
 
 // The max built-in function returns the largest value of a fixed number of