Skip to content
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

go/types: unexport the GoVersion configuration option for Go 1.17 #46296

Closed
findleyr opened this issue May 20, 2021 · 7 comments
Closed

go/types: unexport the GoVersion configuration option for Go 1.17 #46296

findleyr opened this issue May 20, 2021 · 7 comments

Comments

@findleyr
Copy link
Contributor

@findleyr findleyr commented May 20, 2021

+pkg go/types, type Config struct, GoVersion string

The GoVersion field was added to types.Config to configure the language version being type checked.

CC @griesemer

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented May 28, 2021

No proposal here either.

Loading

@findleyr
Copy link
Contributor Author

@findleyr findleyr commented May 28, 2021

This change was ported from types2, where it was needed IIRC to support -lang. It being exported was incidental, and for that reason in particular perhaps we should unexport this field and discuss it for 1.18. @griesemer, what do you think?

Loading

@griesemer
Copy link
Contributor

@griesemer griesemer commented May 28, 2021

Some features (and thus error messages) depend on the Go version. As long as we're ok with go/types running against the latest language version we don't need to expose this.

Loading

@findleyr
Copy link
Contributor Author

@findleyr findleyr commented May 28, 2021

Some features (and thus error messages) depend on the Go version. As long as we're ok with go/types running against the latest language version we don't need to expose this.

To clarify, I think this is a useful feature, and we should expose it eventually. But the fact that it was exposed in go/types for 1.17 was incidental. The real reason it was added was for consistency with types2 (and because it has value of course). At the time we weren't thinking about 1.17.

If we think it's minor enough not to require a proposal, we can leave it in, but I certainly don't want it to be perceived as bypassing the proposal process. Since no one is clamoring for this change, unexporting the field and making a brief proposal at the start of the 1.18 cycle seems like a fine option. I feel roughly the same about #46298, though I think that change is even more minor.

I defer to both of you, as members of the proposal committee, for what is OK.

Loading

@griesemer
Copy link
Contributor

@griesemer griesemer commented May 28, 2021

Sorry for not being clear: What I meant is that we don't need to expose this for Go1.17. We can discuss what needs to be done for Go1.18.

Loading

@findleyr findleyr changed the title doc/go1.17: document go/types changes for Go 1.17 go/types: unexport the GoVersion configuration option for Go 1.17 May 28, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented May 28, 2021

Change https://golang.org/cl/323430 mentions this issue: go/types: unexport the GoVersion configuration option for Go 1.17

Loading

@gopherbot gopherbot closed this in 1607c28 May 30, 2021
@findleyr
Copy link
Contributor Author

@findleyr findleyr commented Jun 8, 2021

Filed a proposal at #46648 to discuss this feature for 1.18.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants