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