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

go/ast: define value for the direction of bidirectional channel #22815

nishanths opened this issue Nov 20, 2017 · 4 comments

go/ast: define value for the direction of bidirectional channel #22815

nishanths opened this issue Nov 20, 2017 · 4 comments


Copy link

@nishanths nishanths commented Nov 20, 2017

The value for the direction of a bidirectional channel isn't defined in the go/ast package [1]. The parser method,(*go/ast.parser).parseChanType, uses ast.SEND | ast.RECV as a substitute.

The proposal is to either:

  1. Declare a constant in package ast: BOTH = SEND | RECV; or
  2. Document in package ast that a bidirectional channel's direction has the value SEND | RECV.

Either option will provide a documented value that clients of package ast can use.


Copy link

@mvdan mvdan commented Nov 20, 2017

@mvdan mvdan added the Suggested label Nov 20, 2017
@griesemer griesemer self-assigned this Nov 20, 2017
@griesemer griesemer added this to the Go1.10 milestone Nov 20, 2017
@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017
Copy link

@rsc rsc commented Nov 22, 2017

Too late to add new API to Go 1.10.

Copy link

@dominikh dominikh commented Nov 22, 2017

This should be a simple documentation fix. ChanDir is intended as a bit mask, shown by SEND's and RECV's definition as 1 << iota, but ChanDir's documentation says that "The direction of a channel type is indicated by one of the following constants".

Copy link

@gopherbot gopherbot commented Nov 29, 2017

Change mentions this issue: go/ast: improve documentation for channel directions

@gopherbot gopherbot closed this in 98a8e52 Nov 29, 2017
@golang golang locked and limited conversation to collaborators Nov 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.