Commit Graph

12 Commits

Author SHA1 Message Date
Alan Donovan 2e348630fd go/loader: fix fragile example test
Change-Id: Ib6313cdba54da8911b8a2ec9e1bc115c30ea6afe
Reviewed-on: https://go-review.googlesource.com/32817
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-04 21:44:43 +00:00
Robert Griesemer d54c98191e go/loader: fix ExampleConfig_Import (fix build)
TBR=adonovan

Tested against 1.6, 1.7, and 1.8.

Change-Id: Ifd8e02a83e7b92c00a746f10475ab725801199e2
Reviewed-on: https://go-review.googlesource.com/32638
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-11-02 23:31:09 +00:00
Alan Donovan 992f6f9bcc go/loader: fix CreateFromFilenames example
The "sort" package is no longer quite as low-level as it once was.

Change-Id: Ic62d780841ef1172f65d4c00ec500994f94cb4b7
Reviewed-on: https://go-review.googlesource.com/30931
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-12 15:34:52 +00:00
Alan Donovan ae186f56a2 go/loader: don't treat unsafe specially wrt vendoring
The loader treats GOROOT's "unsafe" package specially,
with no source files and a Package of types.Unsafe.

Tested on Go 1.4.1, 1.5, and ~1.6 (tip).

Fixes issue #13882

Change-Id: I86c4e394665d86a50ec3852d6d702f0e9c5d2276
Reviewed-on: https://go-review.googlesource.com/18457
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-08 20:29:04 +00:00
Alan Donovan 2b78567943 go/loader: fix tests to work at go1.5 and tip
Change-Id: Icc80f112a7ec4b64519220c57b6ccb2612166656
Reviewed-on: https://go-review.googlesource.com/18197
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-28 22:42:32 +00:00
Alan Donovan 9b7a39c6be go/loader: fix brittle example test
We need a better approach for tests such as these.

Change-Id: I6fb608acc096088fe377f6f2c40ff6124cf3d09c
Reviewed-on: https://go-review.googlesource.com/18194
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-28 21:24:47 +00:00
Alan Donovan 42bc1282f3 go/loader: update example_test for Go1.6
Change-Id: Ib3bf913e3c8f3cf06ba855f8dda855453e0a1aa2
Reviewed-on: https://go-review.googlesource.com/18048
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-18 18:15:14 +00:00
Robert Griesemer 50fdc6b946 go/loader: exclude example tests from Windows tests
The output of ExampleConfig_CreateFromFiles and ExampleConfig_Import
are different for Windows that for other platforms: They contain
internal/syscall/windows packages and unicode/utf16 not present in
the output for other platforms.

For golang/go#11811.

Change-Id: Id391fbeec8123616da86cb68fc3cefcd513b2493
Reviewed-on: https://go-review.googlesource.com/13032
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-31 22:13:26 +00:00
Alan Donovan 14b8253455 go/loader: fork example_test.go for go1.4 since the expectations differ
Change-Id: I91138351525ce49b9afccdc66c59e7a4c1c0e096
Reviewed-on: https://go-review.googlesource.com/12870
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-07-30 00:13:23 +00:00
Alex Brainman 166a1118e9 go/loader: update examples Output
Some standard library dependencies have changed (packages and files).
Both ExampleConfig_CreateFromFiles and ExampleConfig_Import Output
needs to be adjusted. Do that.

Update golang/go#11811

Change-Id: I523f2adc1aa46f0932a71ccb23dd7c5a6b07fb27
Reviewed-on: https://go-review.googlesource.com/12832
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-07-29 16:23:00 +00:00
Alan Donovan 41d9a0e7b2 go/loader: rename Example functions to appease godoc
And other minor cosmetic tweaks.

Change-Id: Ic75d405e6eca8f29b7e97de66fb86f1f39bcae1e
Reviewed-on: https://go-review.googlesource.com/9035
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-04-17 19:40:02 +00:00
Alan Donovan 1b6275a2ec go/loader: API examples
Also: make it easier to find packages.  Hide the importMap field
(never used) and expose a (*Program).Package method which searches
importMap and then Created.

Also: move huge comments into doc.go.

Change-Id: Iad96a12524b7c41ad9acd1e806af23171e71fa7c
Reviewed-on: https://go-review.googlesource.com/9030
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-04-17 18:50:18 +00:00