Fix "import object is expected Error" in Golang 1.4.2
Upon upgrading Golang from 1.3 to 1.4.2, encountering an import issue:
../../my/mandrill.go:5: import /path/to/go/home/pkg/darwin_amd64/github.com/keighl/mandrill.a: object is [darwin amd64 go1.3.3 X:precisestack] expected [darwin amd64 go1.4.2 X:precisestack] FAIL folder [build failed]
This error occurs due to potential changes in import rules in Golang 1.4.2.
Solution:
The issue arises from outdated pkg files. To resolve it, delete these files:
rm -rf $GOPATH/pkg/
Typically, these files are upgraded automatically, but manually deleting them ensures the updated version is used during compilation.
The above is the detailed content of Why Am I Getting \'import object is expected\' Error After Upgrading Golang to 1.4.2?. For more information, please follow other related articles on the PHP Chinese website!