From: task4233 Date: Tue, 2 Feb 2021 03:54:24 +0000 (+0000) Subject: spec: improve the example in Type assertions section X-Git-Tag: go1.16~1^2~29 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fca94ab3ab;p=gostls13.git spec: improve the example in Type assertions section The example, var v, ok T1 = x.(T), can be interpreted as type T1 interface{} or type T = bool; type T1 = T. Separating the example would help understanding for readers. Change-Id: I179f4564e67f4d503815d29307df2cebb50c82f9 GitHub-Last-Rev: b34fffb6bb07cb2883bc313ef3bc9980b3dd4abe GitHub-Pull-Request: golang/go#44040 Reviewed-on: https://go-review.googlesource.com/c/go/+/288472 Reviewed-by: Robert Griesemer Reviewed-by: Rob Pike Reviewed-by: Ian Lance Taylor Trust: Robert Griesemer --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 676407f6f2..c9e14a3fec 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -3400,7 +3400,7 @@ A type assertion used in an assignment or initializat v, ok = x.(T) v, ok := x.(T) var v, ok = x.(T) -var v, ok T1 = x.(T) +var v, ok interface{} = x.(T) // dynamic types of v and ok are T and bool