Don't post the install location for a directory outside of the GOPATH error when running "go get"
Simple Go project with external dependency:
import (
"fmt"
"html"
"log"
"net/http"
"github.com/gorilla/mux"
)
My path works fine for other tasks like run, build, etc .:
GOPATH="/home/racar/go"
But when I try to get the external package with the "get get" command, I got this error:
"go install: no install location for directory ... outside of GOPATH"
Edit: I set my PATH to ~ / .bashrc: export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
+3
source to share
1 answer
According to this link: github.com/golang/go/wiki/SettingGOPATH
You need to specify the GOBIN path in your bash file: export GOBIN=$HOME/work/bin
+4
source to share