Closed gzwsc2007 closed 8 years ago
This is because when you would do a go get github.com/brocaar/loraserver/...
, Go would place all the source-code under $GOPATH/src/github.com/brocaar/loraserver/...
. In Go it is common to use the full repo url as import path. In case of LoRa Server, all requirements are vendored, if that would not be the case a simple go get ./...
would fetch all requirements for you 😄
When you move your clone to the above path ($GOPATH/src/github.com/brocaar/loraserver/...
), everything should work.
Thank you very much for answering my question! :D
Is there anyway to change the import names from "github.com/xxx/xxx" to "common/xxx"(something as I want). My requirement is, I don't want to see these github.com/xxx/xxx in the build file to avoid the complete details about what I'm using if I open the go build file in text editor.
i think github and gitlab donate for go team a huge money :v
I am new to Go, so please pardon me if this question is stupid.
When I pull down the
loraserver
repo, and domake
, I get errors likeinternal/loraserver/interfaces.go:4:2: cannot find package "github.com/brocaar/loraserver/models" in any of: ........
internal/loraserver/loraserver.go:12:2: cannot find package "github.com/brocaar/loraserver/models" in any of:.........
If I change all the
"github.com/brocaar/loraserver/....."
to"loraserver/......"
, then the code compiles.I am using GO 1.6 and my GOPATH and GOROOT are setup correctly. What I don't understand is that, why are we prepending
loraserver
withgithub.com/brocaar/
? Isn'tloraserver
a local package instead of a vendor package?Thanks in advance.