Standard library / go/types
go/types.Chan
Represents a Go chan type in the semantic model, not a runtime value. Expected stdout: 'chan<- int\n'.
Formal Syntax & Structure
go syntaxgo
type Chan struct {}Working Example
Example Snippetgo
package main
import ( "fmt" "go/types")
func main() { t := types.NewChan(types.SendOnly, types.Typ[types.Int]); fmt.Println(t) }