Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in "The Go Programming Language Specification" documentation #3855

Closed
gopherbot opened this issue Jul 23, 2012 · 4 comments
Closed

error in "The Go Programming Language Specification" documentation #3855

gopherbot opened this issue Jul 23, 2012 · 4 comments

Comments

@gopherbot
Copy link
Contributor

by simon.place:

http://golang.org/ref/spec#Channel_types

<quote>
chan<- float64  // can only be used to send float64s
<-chan int      // can only be used to receive ints
</quote>

this is the wrong way round.
@remyoudompheng
Copy link
Contributor

Comment 1:

What do you mean by "way"?

@gopherbot
Copy link
Contributor Author

Comment 2 by simon.place:

i don't really know how to say it differently, in English 'wrong way round' is common 
and means transposed(swapped) incorrectly.  
here the channel direction is the 'wrong way round', to correct swap them, or the
descriptions.
example;
chan<- float64  // can only be used to receive float64s
<-chan int      // can only be used to send ints

@robpike
Copy link
Contributor

robpike commented Jul 23, 2012

Comment 3:

You are wrong, or perhaps misunderstand. http://play.golang.org/p/ZZfK9PUiqy
If you have a variable of type chan<- float64, the only thing you can do with it is
send a float64.

Status changed to Invalid.

@gopherbot
Copy link
Contributor Author

Comment 4 by simon.place:

"chan<- float64, the only thing you can do with it is send a float64."
yes, this says YOU SEND to the channel, because the subject, the thing that the send
refers to is you.
but that's NOT what is written in the comment, in it the subject of the sentence is the
CHANNEL, so what it says is that the CHANNEL can SEND, which is wrong.
you could fix this simply by changing the subject to YOU, like this;
"chan<- float64  // can only be used to send float64s to"
and
"<-chan int      // can only be used to receive ints from"

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants