Standard library / reflect
reflect.BothDir
ChanDir constant for a bidirectional channel type. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
const BothDir ChanDir = 3Working Example
Example Snippetgo
package main
import ( "fmt" "reflect")
func main() { fmt.Println(reflect.TypeOf((chan int)(nil)).ChanDir() == reflect.BothDir) }