Golang go/ast.AssignStmt type example

package go/ast

An AssignStmt node represents an assignment or a short variable declaration.

Golang go/ast.AssignStmt type usage example

 func checkLeftRightHands(node ast.Node) string {
 n := node.(*ast.AssignStmt)
 if len(n.Lhs) != len(n.Rhs) {
 return
 }
 return "matching"
 }

Reference :

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

Advertisement