]> Cypherpunks repositories - gostls13.git/commit
go/scanner: continue adding directory to file name
authorIan Lance Taylor <iant@golang.org>
Thu, 2 Aug 2018 19:35:32 +0000 (12:35 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 2 Aug 2018 21:34:24 +0000 (21:34 +0000)
commitd6597ade89b03a5bd5b6732506c23de741cccd53
tree04144d0e371ad675e10004fd270ac0605ce49ed5
parent8589f46fe07998bd3b27a0cebce2f428e68014e0
go/scanner: continue adding directory to file name

Before CL 97795, when go/scanner saw a //line comment, it would clean
the path and, if the path was relative, prepend the directory from the
file name. This was not the best API because it meant that the
behavior changed based on whether the code was running on Windows or
not, and it meant that information from the //line directive was lost.
So in CL 97795, among other changes, go/scanner was changed to simply
return the filename given in the //line comment.

Unfortunately existing tools such as unparam and unconvert expected
the old behavior. In order to avoid breaking those tools, revert that
part of the change.

Fixes #26671

Change-Id: Ifa06542bd19cda9d682ac33766ab9080444ba050
Reviewed-on: https://go-review.googlesource.com/127658
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/go/scanner/scanner.go
src/go/scanner/scanner_test.go