Standard library / go/token

go/token.Token.IsOperator()

Reports whether the token is an operator or delimiter, including TILDE. Expected stdout: 'true true true\n'.

Formal Syntax & Structure

go syntaxgo
func (tok Token) IsOperator() bool

Return Value

bool

Reports whether the token is an operator or delimiter, including TILDE.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/token")
func main() { fmt.Println(token.ADD.IsOperator(), token.LPAREN.IsOperator(), token.TILDE.IsOperator()) }
Go Reference