Why Am I Getting \'import object is expected\' Error After Upgrading Golang to 1.4.2?

Barbara Streisand
Release: 2024-11-02 07:56:02
Original
646 people have browsed it

Why Am I Getting

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]
Copy after login

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/
Copy after login

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!