commit | 0f72e79856d246af85c449f9e5a357ba751cd234 | [log] [tgz] |
---|---|---|
author | Alan Donovan <adonovan@google.com> | Fri Sep 07 09:54:38 2018 -0400 |
committer | Alan Donovan <adonovan@google.com> | Mon Sep 10 18:29:25 2018 +0000 |
tree | e28876ef1b097c9b7a13bf740b5f4c9a9e333223 | |
parent | 12c5ca90a00768c6ad5f6d83f7c37964a30256fb [diff] |
go/token: add (*File).LineStart, which returns Pos for a given line LineStart returns the position of the start of a given line. Like MergeLine, it panics if the 1-based line number is invalid. This function is especially useful in programs that occasionally handle non-Go files such as assembly but wish to use the token.Pos mechanism to identify file positions. Change-Id: I5f774c0690074059553cdb38c0f681f5aafc8da1 Reviewed-on: https://go-review.googlesource.com/134075 Reviewed-by: Robert Griesemer <gri@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.