]> Cypherpunks repositories - gostls13.git/commitdiff
go/token: document postcondition of SetLines
authorAlan Donovan <adonovan@google.com>
Thu, 5 May 2016 21:56:58 +0000 (14:56 -0700)
committerAlan Donovan <adonovan@google.com>
Thu, 5 May 2016 22:06:31 +0000 (22:06 +0000)
Change-Id: Ie163deade396b3e298a93845b9ca4d52333ea82a
Reviewed-on: https://go-review.googlesource.com/22831
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/go/token/position.go

index 33751779a3d9b53615a9b521baf7ab9eeca72ce3..7306083b0dd8ace37c4005dba49f42fdd7462f00 100644 (file)
@@ -164,6 +164,7 @@ func (f *File) MergeLine(line int) {
 // Each line offset must be larger than the offset for the previous line
 // and smaller than the file size; otherwise SetLines fails and returns
 // false.
+// Callers must not mutate the provided slice after SetLines returns.
 //
 func (f *File) SetLines(lines []int) bool {
        // verify validity of lines table