Please answer these questions before submitting your issue. Thanks!
go version)?1.11
Yes
go env)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
In a dockerfile, the following command fails during the docker image build
go get golang.org/x/lint/golint
Error
# golang.org/x/tools/go/internal/gcimporter
/go/src/golang.org/x/tools/go/internal/gcimporter/bexport.go:212: obj.IsAlias undefined (type *types.TypeName has no field or method IsAlias)
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Successful docker image build.
Error with exit status 2 for the failed installation of golang linter with the following error
# golang.org/x/tools/go/internal/gcimporter
/go/src/golang.org/x/tools/go/internal/gcimporter/bexport.go:212: obj.IsAlias undefined (type *types.TypeName has no field or method IsAlias)
That method was added in 1.9: https://golang.org/pkg/go/types/#TypeName.IsAlias
Are you positive you're building on 1.11?
Having the same problem with golang 1.8. What is your solution to this issue?
You can check the PR
https://github.com/golang/tools/pull/52
for the solution.
On Tue, Oct 23, 2018, 8:01 AM Tianyi Chen notifications@github.com wrote:
Having the same problem with golang 1.8. What is your solution to this
issue?—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/28291#issuecomment-432064601, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ANfqBShoaEQh_mB9WKaCOFQQNCd6iTzbks5unn-ZgaJpZM4Xx0-C
.
I would request you to upgrade to 1.11. We do not support more than 2 releases behind. So the <1.9 kludge may be removed at some point.
I'm confused by this issue - it started mentioning Go 1.11, and now concerns Go 1.8.
Please see the documentation, which clearly shows that the last two Go releases are supported: https://github.com/golang/go/wiki/SubRepositories
I'm having this issue with go1.8, how would we go get a version of golang.org/x/lint/golint that isn't breaking o.O?
The subrepositories, including x/tools, only support the two latest Go versions. See the link I posted above. That currently means at least Go 1.10.
This issue is just going in circles, so I'm going to close it for now. Feel free to open another issue to propose changing the two-version policy. /cc @griesemer @alandonovan
@mvdan what would be the best place to start a discussion about this?
from my naive point of view it seems like it shouldn't be this hard to keep using a compatible version of golint in older go versions, but my background is in programming languages with package managers / repositories that take care of this (nodejs, php, python and the like)
and I do realize that the situation / problem is different here.
On newer Go versions, you would use Go modules to use a specific version of all dependencies, including the x/tools repository. On older Go versions, you can achieve the same with third party dependency management tools like dep or govendor, which can set up vendor directories.
Most helpful comment
That method was added in 1.9: https://golang.org/pkg/go/types/#TypeName.IsAlias
Are you positive you're building on 1.11?