From cae9a9fd65cae6cbde0aacfea8f70e952e89f33e Mon Sep 17 00:00:00 2001
From: Rob Pike
go_spec.html:4526: Warning: trimming empty
A type declaration binds an identifier, the type name, to a type.
Type declarations come in two forms: alias declarations and type definitions.
-
+
go_spec.html:4533: Warning: trimming empty
go_spec.html:4539: Warning: trimming empty
This CL fixes all but the
ones, which I think should be fixed
but are defended by a comment.
Change-Id: I0ca88f5e80755024801877ab1298025ecf8f10c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/214457
Reviewed-by: Brad Fitzpatrick
TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
@@ -2553,7 +2553,7 @@ does not have the same effect as allocating a new slice or map value with
-p1 := &[]int{} // p1 points to an initialized, empty slice with value []int{} and length 0 +p1 := &[]int{} // p1 points to an initialized, empty slice with value []int{} and length 0 p2 := new([]int) // p2 points to an uninitialized slice with value nil and length 0@@ -3290,8 +3290,8 @@ array with the operand.
var a [10]int -s1 := a[3:7] // underlying array of s1 is array a; &s1[2] == &a[5] -s2 := s1[1:4] // underlying array of s2 is underlying array of s1 which is array a; &s2[1] == &a[5] +s1 := a[3:7] // underlying array of s1 is array a; &s1[2] == &a[5] +s2 := s1[1:4] // underlying array of s2 is underlying array of s1 which is array a; &s2[1] == &a[5] s2[1] = 42 // s2[1] == s1[2] == a[5] == 42; they all refer to the same underlying array element-- 2.50.0