import ( "fmt" "go/token" ) func main() { pos := token.Position{ Filename: "example.go", Line: 1, Column: 5, } fmt.Println(pos) }
import ( "fmt" "go/token" ) func main() { tok := token.Token{ Pos: token.Position{Filename: "example.go", Line: 1, Column: 5}, Type: token.INT, Value: "42", } fmt.Println(tok) }This code creates a Token object with a Position object, a type of token.INT (indicating an integer value), and a value of "42". It then prints out the Token object. These examples use the go.token package in Go.