导入对象预计在Golang 1.4.2中出现错误 [英] import object is expected Error in Golang 1.4.2
本文介绍了导入对象预计在Golang 1.4.2中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚将Golang从 1.3
升级到版本 1.4.2
。由于错误导致无法编译:
../../ my / mandrill.go:5:import / path / to /go/home/pkg/darwin_amd64/github.com/keighl/mandrill.a:object是[darwin amd64 go1.3.3 X:precisestack]预计[darwin amd64 go1.4.2 X:precisestack]
FAIL文件夹[build失败]
在线 mgithub.com/keighl/mandrill
package my
import(
fmt
mgithub.com/keighl/mandrill
)
我想有些规则的导入已在 1.4.2
中更改。但无法弄清楚如何更改我的导入代码以便编译它。 解决方案
只需删除旧的pkg文件,通常会升级
rm -rf $ GOPATH / pkg /
I have just upgraded Golang from 1.3
to version 1.4.2
. And cannot compile due to error:
../../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]
on line m "github.com/keighl/mandrill"
package my
import (
"fmt"
m "github.com/keighl/mandrill"
)
I guess some rules of importing have changed in 1.4.2
. But cannot figure out how to change my import code to make it compile.
解决方案
Just delete the old pkg files, usually it upgrades automatically though.
rm -rf $GOPATH/pkg/
这篇关于导入对象预计在Golang 1.4.2中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文