Make default DataFile work with GOPATH with multiple entries.#132
Make default DataFile work with GOPATH with multiple entries.#132vadimsht wants to merge 1 commit intogoogle:masterfrom vadimsht:datafile
Conversation
|
|
||
| func BenchmarkParse(b *testing.B) { | ||
| filename := dataFile("syntax", "testdata/scan.star") | ||
| filename := starlarktest.DataFile("syntax", "testdata/scan.star") |
There was a problem hiding this comment.
It is already used by this file in TestParseErrors above.
|
I don't understand why this routine is necessary at all. By default, |
|
go is not the only build system. |
|
I can explain why I'm sending this: my project uses starlarktest package, including assert.star it has. Starlark-go code is "vendored" into parallel GOPATH (i.e. all my sources are in /.../go and all third party code, including starlark-go, are in automatically managed /.../go/.vendor). This results in |
|
Since the introduction of the go modules, now this is even more complex since is really hard found the path where is the source code. I believe that the easiest way to solve this is embed the source code of |
It's not a big deal if this pull request is rejected, since DataFile is overridable and I can override it in my projects instead (it uses multiple GOPATHs).