I ran
go get -u github.com/golang/dep/cmd/dep
and I got
package context: unrecognized import path "context" (import path does not begin with hostname)
I'm on Ubuntu 16.04.
How can I fix this? Is this a known issue?
same here
I think I fixed this by installing latest version of Go. What version do you have?
root@hostname:~/go/src/github.com/kotakanbe/go-cve-dictionary# go version
go version go1.10.1 linux/amd64
i think the latest you could have
It may just have been a path issue.
It may just have been a path issue.
Would you mind showing me your go env?
missing package installable by
git clone https://github.com/gorilla/context /root/go/src/github.com/golang/dep/vendor/context
This is pretty bizarre - context has been in stdlib for some time. i've no idea how that outcome could occur on go 10.1 馃槙
sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go get github.com/go-sql-driver/mysql
It's work for me.
This solution worked for me. Thank you.
sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go get github.com/mattn/goreman
This solution worked for me. Very thanks.
sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go/github.com/zouchengli
It's work for me.
export GOROOT=/usr/local/go
encountered this with 1.6. need to install 1.12 and it works but the issue really i guess is exporting GOROOT, GOPATH and adding bin to PATH
Worked for me in Ubuntu 16.04 with :
export GOROOT=/usr/local/go
setup along the solution
sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go get github.com/go-sql-driver/mysql
It's work for me.
Thx this worked!
I just do not understand what is the reason it fails on ubuntu 16.04.
sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go get github.com/go-sql-driver/mysql
It's work for me.
warning: GOPATH set to GOROOT (/root/go) has no effect
package github.com/go-delve/delve/cmd/dlv: cannot download, $GOPATH must not be set to $GOROOT. For more details see: 'go help gopath'
if I change GOPATH to a different one, i got a bunch of error like below:
package go/printer: unrecognized import path "go/printer" (import path does not begin with hostname)
package go/scanner: unrecognized import path "go/scanner" (import path does not begin with hostname)
package go/token: unrecognized import path "go/token" (import path does not begin with hostname)
package net: unrecognized import path "net" (import path does not begin with hostname)
package unicode/utf16: unrecognized import path "unicode/utf16" (import path does not begin with hostname)
package encoding/xml: unrecognized import path "encoding/xml" (import path does not begin with hostname)
package os/signal: unrecognized import path "os/signal" (import path does not begin with hostname)
package net/rpc: unrecognized import path "net/rpc" (import path does not begin with hostname)
package net/rpc/jsonrpc: unrecognized import path "net/rpc/jsonrpc" (import path does not begin with hostname)
package container/ring: unrecognized import path "container/ring" (import path does not begin with hostname)
package math/big: unrecognized import path "math/big" (import path does not begin with hostname)
package compress/gzip: unrecognized import path "compress/gzip" (import path does not begin with hostname)
package runtime/debug: unrecognized import path "runtime/debug" (import path does not begin with hostname)
package text/tabwriter: unrecognized import path "text/tabwriter" (import path does not begin with hostname)
package encoding/csv: unrecognized import path "encoding/csv" (import path does not begin with hostname)
package flag: unrecognized import path "flag" (import path does not begin with hostname)
package text/template: unrecognized import path "text/template" (import path does not begin with hostname)
root@3c5941531562:~# go version
go version go1.11.1 linux/amd64
Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!
Most helpful comment
sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go get github.com/go-sql-driver/mysql
It's work for me.