Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

import object is expected Error in Golang 1.4.2

Tags:

go

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.

like image 699
Maxim Yefremov Avatar asked Mar 09 '15 02:03

Maxim Yefremov


1 Answers

Just delete the old pkg files, usually it upgrades automatically though.

rm -rf $GOPATH/pkg/
like image 184
OneOfOne Avatar answered Oct 03 '22 17:10

OneOfOne