Why "go build" cannot find package?
go, package
Solution
That doesn't seem to be normally possible for the moment : https://code.google.com/p/go/issues/detail?id=2775
Maybe for Go1.1
A trick (that I didn't test) by Dave :
For a package called "hello", the go tool will look for .go sources in $GOPATH/src/hello, and only rebuild if the timestamp of the .a file is before the latest timestamp of the .go files. An easy way to fool it into accepting just the .a file is to drop a dummy .go file in the correct src directory and set its timestamp to before that of the .a file.
(this is a community answer, using what is said on golang-nuts).
Problem
I installed a `test0` package to `$gopath\pkg\windows_386\hello\test0.a`, but when i build a main package which depends on the `test0` package, the compiler says: `import "hello/test0": cannot find package`. why this happens? I have two go file: `$gopath/src/hello.go` ``` package main import ( "fmt" "hello/test0" ) func main() { fmt.Println(test0.Number) } ``` `$gopath/src/hello/test0/test0.go` ``` package test0 const ( Number int = 255 ) ``` At first, i run `go install hello/test0`, and it generated `$gopath\pkg\windows_386\hello\test0.a` then, i delete the directory `$gopath/src/hello` finally, i run `go build hello.go`, and the compiler sayed `hello.go:5:2: import "hello/test0": cannot find package`