Golang go/ast.CommClause type example

package go/ast

A CommClause node represents a case of a select statement.

Golang go/ast.CommClause type usage example

  func NodeDescription(n ast.Node) string {
 switch n := n.(type) {
 case *ast.ArrayType:
 return "array type"
 case *ast.AssignStmt:
 return "assignment"
 case *ast.CommClause:
 return "communication clause"
 ...
  }

Reference :

http://golang.org/pkg/go/ast/#CommClause

Advertisement