-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types: move to go.exp subrepo #4870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
Special casing this is going to be a significant burden on the distribution code: it's going to be mostly untested and break when we try to do the actual distribution. I'd much rather find a mechanism that doesn't require last-minute tweaking of the tree. Here is an alternative: 1. Move go/types to the go.exp subrepo. 2. Arrange so that cmd/vet has all its references to go/types in one file that can be dropped from the build. Mark that file with // +build gotypes. 3. People who want the typed vet run 'go install -tags gotypes cmd/vet'. It also gives people who have Go 1.1 and want to try go/types a way to do so. Russ |
(3) of course requires fixing issue #4443, which is marked to be fixed anyway. |
Just for the record: 1) The main reason for excluding it from Go 1.1 is that we might find issues that require the API to change in non-compatible ways. 2) There's another alternative: Allow it in Go 1.1 but permit its API to change if necessary (with a big disclaimer in the file, of course). I think that would actually be the easiest from a release and testing point of view. There is a danger of setting an unfortunate precedent. Labels changed: removed go1.1. |
You could include it in Go 1.1, but make main sign a disclaimer that they know it's experimental: package main import ( "go/exp" // a new package "github.com/bob/foo" // which itself imports go/types, included in Go 1.1 ) func main() { // Enable the experimental go/types API. The Enable call only // works from main.main. If go/types is used without being enabled, // it panics. exp.Enable("go/types") foo.Something() // ... which uses go/types. But foo can't Enable itself. Only main can. } By making main declare that, it prevents: user A's main -> user B's foo -> go/types 1.1 (works) user A's main -> user B's foo -> go/types 1.2 (explodes) ... and surprising user A, who didn't know how user B's foo was implemented. |
https://golang.org/cl/7528044 adds -tags gotypes to the build, so vet's conditional compilation is configured to use go/types. Remove before Go 1.1 |
This issue was closed by revision golang/exp@38d2410. Status changed to Fixed. |
zend
pushed a commit
to go-src/inotify
that referenced
this issue
Apr 3, 2015
See also https://golang.org/cl/7625048 Fixes golang/go#4870. R=golang-dev, gri CC=golang-dev https://golang.org/cl/7656044
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: