<p dir="auto">by <strong>robert.swiecki</strong>:</p>
<pre class="notranslate">It prints:

prog.go:55: undefined: closed
prog.go:56: undefined: closed</pre>
<p dir="auto">by <strong>hanbing.liu</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
1. Check <a href="http://golang.org/doc/go_mem.html" rel="nofollow">http://golang.org/doc/go_mem.html</a> 

On "is allowed to observe": 

"""
A read r of a variable v is allowed to observe a write w to v if both of the following
hold:

    w happens before r.
    There is no other write w' to v that happens after w but before r.
"""

What is the expected output?
""" 
   A read r of a variable v is allowed to observe a write w to v if
   both of the following hold:
    1. w happens before r.
    2. There is no other write w' to v that happens after w but before r.

   A read r of a variable v is also allowed to observe a write w to v if w happens concurrently with r.

   If a w does not fit into either of these two cases,  a read r of
   variable v is not allowed to observe the write w to v.
"""

What do you see instead?

"""
A read r of a variable v is allowed to observe a write w to v if both of the following
hold:

    w happens before r.
    There is no other write w' to v that happens after w but before r.
"""

Which compiler are you using (5g, 6g, 8g, gccgo)?

N/A


Which operating system are you using?
N/A

Which revision are you using?  (hg identify)
N/A

Please provide any additional information below.

The existing statement concerning "is allowed to observe" meant to define what
are the possible set of w that may provide the value seen by the r. 

Broadly there are three types of w. (1) those w that happens-before r (2) those w that w
happens-after s (3) those w that happens concurrently with r. 

The existing statement only says what subset of w from (1) is allowed to by observed by
r. 

My revision, will be more explicit on the intended definition of "is allowed to
observe".

Thanks.</pre>