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