Golang go/ast.BranchStmt type example
package go/ast
A BranchStmt node represents a break, continue, goto, or fallthrough statement.
Golang go/ast.BranchStmt 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.BranchStmt:
switch n.Tok {
case token.BREAK:
return "break statement"
case token.CONTINUE:
return "continue statement"
case token.GOTO:
return "goto statement"
case token.FALLTHROUGH:
return "fall-through statement"
}
...
}
Reference :
Advertisement
Something interesting
Tutorials
+10k Golang : Convert octal value to string to deal with leading zero problem
+6.1k Golang : How to write backslash in string?
+5k Golang : Constant and variable names in native language
+12k Golang : Find and draw contours with OpenCV example
+8.3k Golang : Configure Apache and NGINX to access your Go service example
+32.1k Golang : Validate email address with regular expression
+7.1k Golang : A simple forex opportunities scanner
+10.7k Golang : Underscore string example
+5.6k Swift : Get substring with rangeOfString() function example
+6k Golang : Function as an argument type example
+10.6k Golang : Get local time and equivalent time in different time zone
+5.4k Gogland : Datasource explorer