Golang go/ast.LabeledStmt type example

package go/ast

A LabeledStmt node represents a labeled statement.

Golang go/ast.LabeledStmt 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.LabeledStmt:
 return "statement label"
  }

Reference :

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

Advertisement