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

cannot find package "context" #6

Closed
jerkyrs opened this issue Jun 4, 2018 · 5 comments
Closed

cannot find package "context" #6

jerkyrs opened this issue Jun 4, 2018 · 5 comments
Assignees

Comments

@jerkyrs
Copy link
Contributor

jerkyrs commented Jun 4, 2018

  1. What i did

Tried to run

make fmt; make build
  1. What i saw
iotex-core/logger/logger.go:10:2: cannot find package "context" in any of:
  1. What i expected to see
    Build work properly.

It would appear as though context is imported but not available, it was not installed with other glide installation like in glide.yaml

- package: golang.org/x/net
@zjshen14
Copy link
Contributor

zjshen14 commented Jun 4, 2018

Tryglide update and then glide install again?

@zjshen14 zjshen14 self-assigned this Jun 4, 2018
@SoyTheCat
Copy link
Contributor

SoyTheCat commented Jun 4, 2018

golang.org/x/net/context is moved to std context since Go 1.7. We can resolve this issue by rename all golang.org/x/net/context import usage into using just context.

@jerkyrs
Copy link
Contributor Author

jerkyrs commented Jun 4, 2018

i am running on go 1.6.1 , it wants the context import to be declared as golang.org/x/net/context

I added the - package: goland.org/x/net manually to glide.yaml and got further but still got

go build -o ./bin/server -v ./server
logger/logger.go:10:2: cannot find package "context" in any of:

@SoyTheCat
Copy link
Contributor

our environment use go 1.9. Please upgrade your go version to avoid unexpected error

@jerkyrs
Copy link
Contributor Author

jerkyrs commented Jun 4, 2018

so i updated to go 1.9

[iotex@localhost iotex-core]$ go version
go version go1.9.4 linux/amd64

Works as expected, but as per #5 if this was all done within the Docker container my local environment would be irrelevant

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

No branches or pull requests

3 participants