Standard library / go/types
go/types.Chan.String()
Returns a diagnostic string representation of the type. Expected stdout: 'chan<- int\n'.
Formal Syntax & Structure
go syntaxgo
func (c *Chan) String() stringReturn Value
string
Returns a diagnostic string representation of the type.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/types")
func main() { t := types.NewChan(types.SendOnly, types.Typ[types.Int]); fmt.Println(t.String()) }