Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/imports: use go/packages instead of cmd/api to compute symbols
The API of syscall/js package is generated by reusing cmd/api. That has stopped being a runnable command after an internal refactor in Go 1.20. Since cmd/api was never really supported or meant to be used outside of GOROOT, switch to using go/packages and compute the API more directly ourselves. Also use the same approach to generate the API of package unsafe (whose API is also not present in GOROOT/api files at this time) instead of a fixed list that needs manual maintenance. This adds Add and Slice that were added to package unsafe in Go 1.17. It also removes ArbitraryType, since that symbol isn't a part of package unsafe's API but used in its documentation—it seems like an oversight that it was added in CL 24463. This CL intentionally leaves out unsafe's SliceData, String, StringData that were added in Go 1.20, so I can test out the new relui workflow to send a CL that regenerates this package. Fixes golang/go#58245. For golang/go#38706. Change-Id: Ibe0d89bf0469691bd16e0d0f501e3762256f2239 Reviewed-on: https://go-review.googlesource.com/c/tools/+/464715 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
- Loading branch information