File tree 2 files changed +9
-5
lines changed 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
<!--{
2
2
"Title": "The Go Programming Language Specification",
3
- "Subtitle": "Version of Jun 28 , 2021",
3
+ "Subtitle": "Version of Jul 1 , 2021",
4
4
"Path": "/ref/spec"
5
5
}-->
6
6
@@ -6782,15 +6782,17 @@ <h3 id="Package_unsafe">Package <code>unsafe</code></h3>
6782
6782
6783
6783
< p >
6784
6784
The function < code > Slice</ code > returns a slice whose underlying array starts at < code > ptr</ code >
6785
- and whose length and capacity are < code > len</ code > :
6785
+ and whose length and capacity are < code > len</ code > .
6786
+ < code > Slice(ptr, len)</ code > is equivalent to
6786
6787
</ p >
6787
6788
6788
6789
< pre >
6789
6790
(*[len]ArbitraryType)(unsafe.Pointer(ptr))[:]
6790
6791
</ pre >
6791
6792
6792
6793
< p >
6793
- As a special case, if < code > ptr</ code > is < code > nil</ code > and < code > len</ code > is zero,
6794
+ except that, as a special case, if < code > ptr</ code >
6795
+ is < code > nil</ code > and < code > len</ code > is zero,
6794
6796
< code > Slice</ code > returns < code > nil</ code > .
6795
6797
</ p >
6796
6798
Original file line number Diff line number Diff line change @@ -217,11 +217,13 @@ func Alignof(x ArbitraryType) uintptr
217
217
func Add (ptr Pointer , len IntegerType ) Pointer
218
218
219
219
// The function Slice returns a slice whose underlying array starts at ptr
220
- // and whose length and capacity are len:
220
+ // and whose length and capacity are len.
221
+ // Slice(ptr, len) is equivalent to
221
222
//
222
223
// (*[len]ArbitraryType)(unsafe.Pointer(ptr))[:]
223
224
//
224
- // As a special case, if ptr is nil and len is zero, Slice returns nil.
225
+ // except that, as a special case, if ptr is nil and len is zero,
226
+ // Slice returns nil.
225
227
//
226
228
// The len argument must be of integer type or an untyped constant.
227
229
// A constant len argument must be non-negative and representable by a value of type int;
You can’t perform that action at this time.
0 commit comments