]> Cypherpunks repositories - gostls13.git/commit
go/token: add example for retrieving Position from Pos
authorjimmyfrasche <soapboxcicero@gmail.com>
Mon, 12 Mar 2018 00:15:44 +0000 (17:15 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 13 Mar 2018 03:02:15 +0000 (03:02 +0000)
commit867d07f3ac708556f406f75e08bc68c70567f907
tree0b64ee805f90a33173e341c0912c0f0d9ee3ed44
parent2086f3503e40305da650ac200913a8535c0317ab
go/token: add example for retrieving Position from Pos

There are few uses for the majority of the API in go/token for the
average user. The exception to this is getting the filename, line, and
column information from a token.Pos (reported and absolute. This is
straightforward but figuring out how to do it requires combing through
a lot of documentation. This example makes it more easily discoverable.

Updates #24352.

Change-Id: I0a45da6173b3dabebf42484bbbed30d9e5e20e01
Reviewed-on: https://go-review.googlesource.com/100058
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/go/token/example_test.go [new file with mode: 0644]