summaryrefslogtreecommitdiff
path: root/src/go/token/position.go
Commit message (Collapse)AuthorAgeFilesLines
* go/token: Fix race in FileSet.PositionFor.Jan Mercl2016-08-161-0/+2
| | | | | | | | | | | | | | | | | | | | Methods of FileSet are documented to be safe for concurrent use by multiple goroutines, so FileSet is protected by a mutex and all its methods use it to prevent concurrent mutations. All methods of File that mutate the respective FileSet, including AddLine, do also lock its mutex, but that does not help when PositionFor is invoked concurrently and reads without synchronization what AddLine mutates. The change adds acquiring a RLock around the racy call of File.position and the respective test. Fixes #16548 Change-Id: Iecaaa02630b2532cb29ab555376633ee862315dd Reviewed-on: https://go-review.googlesource.com/25345 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* go/token: document postcondition of SetLinesAlan Donovan2016-05-051-0/+1
| | | | | | Change-Id: Ie163deade396b3e298a93845b9ca4d52333ea82a Reviewed-on: https://go-review.googlesource.com/22831 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: use "reports whether" in place of "returns true if(f)"Josh Bleecher Snyder2015-03-181-3/+3
| | | | | | | | Comment changes only. Change-Id: I56848814564c4aa0988b451df18bebdfc88d6d94 Reviewed-on: https://go-review.googlesource.com/7721 Reviewed-by: Rob Pike <r@golang.org>
* go/token: document that column positions and file offsets are in bytesRobert Griesemer2015-02-231-3/+3
| | | | | | | | Fixes #9948. Change-Id: I7b354fccd5e933eeeb2253a66acec050ebff6e41 Reviewed-on: https://go-review.googlesource.com/5611 Reviewed-by: Alan Donovan <adonovan@google.com>
* build: move package sources from src/pkg to srcRuss Cox2014-09-081-0/+485
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.