Standard library / go/token

go/token.Position.String()

Formats available filename, line and byte column. Expected stdout: 'demo.go:2:3\n'.

Formal Syntax & Structure

go syntaxgo
func (pos Position) String() string

Return Value

string

Formats available filename, line and byte column.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/token")
func main() { p := token.Position{Filename: "demo.go", Line: 2, Column: 3}; fmt.Println(p.String()) }
Go Reference