Install "context" package in golang?

I faced similar issue , below are the steps to fix:

  1. Download the latest version https://golang.org/doc/install?download=go1.9.2.linux-arm64.tar.gz

  2. Extract the tar to /usr/local/ .

Use Command -> tar -xzvf go1.9.2.linux-arm64.tar.gz -C /usr/local

  1. Replace the symlink pointing to go:

sudo rm /usr/bin/go
sudo ln -s /usr/local/go/bin/go /usr/bin/go

Reference: https://github.com/DieterReuter/arm64-docker-builder/issues/7


change import "context" to import "golang.org/x/net/context".

but after go 1.7 you can use import "context", as it had become a standard library.

Go 1.7 moves the golang.org/x/net/context package into the standard library as context.

see 1.7 release notes: https://golang.org/doc/go1.7#context

Tags:

Go