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
+6.9k Golang : How to setup a disk space used monitoring service with Telegram bot
+13.9k Golang : How to determine if a year is leap year?
+31.9k Golang : Convert an image file to []byte
+17.5k Golang : Clone with pointer and modify value
+10.2k Golang : Random Rune generator
+14.4k Android Studio : Use image as AlertDialog title with custom layout example
+19.4k Golang : How to count the number of repeated characters in a string?
+30k Golang : Get time.Duration in year, month, week or day
+18.2k Golang : Get command line arguments
+5.4k Golang : fmt.Println prints out empty data from struct
+6.3k Golang : Detect face in uploaded photo like GPlus
+9k Golang : Inject/embed Javascript before sending out to browser example