mirror of
https://github.com/golang/go
synced 2024-11-24 00:10:04 -07:00
doc/go1: minor html fixes
R=golang-dev, r CC=golang-dev https://golang.org/cl/5572064
This commit is contained in:
parent
f8a28ecc9f
commit
7c9ee5f369
@ -74,8 +74,8 @@ to call <code>close</code> on a receive-only channel:
|
||||
|
||||
<pre>
|
||||
var c chan int
|
||||
var csend chan<- int = c
|
||||
var crecv <-chan int = c
|
||||
var csend chan<- int = c
|
||||
var crecv <-chan int = c
|
||||
close(c) // legal
|
||||
close(csend) // legal
|
||||
close(crecv) // illegal
|
||||
@ -328,8 +328,8 @@ This function implicitly returns a shadowed return value and will be rejected by
|
||||
|
||||
<pre>
|
||||
func Bug() (i, j, k int) {
|
||||
for i = 0; i < 5; i++ {
|
||||
for j := 0; j < 5; j++ { // Redeclares j.
|
||||
for i = 0; i < 5; i++ {
|
||||
for j := 0; j < 5; j++ { // Redeclares j.
|
||||
k += i*j
|
||||
if k > 100 {
|
||||
return // Rejected: j is shadowed here.
|
||||
|
@ -67,8 +67,8 @@ to call <code>close</code> on a receive-only channel:
|
||||
|
||||
<pre>
|
||||
var c chan int
|
||||
var csend chan<- int = c
|
||||
var crecv <-chan int = c
|
||||
var csend chan<- int = c
|
||||
var crecv <-chan int = c
|
||||
close(c) // legal
|
||||
close(csend) // legal
|
||||
close(crecv) // illegal
|
||||
@ -263,8 +263,8 @@ This function implicitly returns a shadowed return value and will be rejected by
|
||||
|
||||
<pre>
|
||||
func Bug() (i, j, k int) {
|
||||
for i = 0; i < 5; i++ {
|
||||
for j := 0; j < 5; j++ { // Redeclares j.
|
||||
for i = 0; i < 5; i++ {
|
||||
for j := 0; j < 5; j++ { // Redeclares j.
|
||||
k += i*j
|
||||
if k > 100 {
|
||||
return // Rejected: j is shadowed here.
|
||||
|
Loading…
Reference in New Issue
Block a user