How do I go about resolving an import cycle between github.com/golang/mock/gomock
and golang.org/x/net/context
? As far as I can tell this cycle exists internally between the two package and I can't modify either of them internally.
Currently these are my imports:
import (
"testing"
"github.com/golang/mock/gomock"
"gopkg.in/mgo.v2" //mock
"gopkg.in/mgo.v2/bson"
)
And this is the exact error message I am receiving when running withmock go test
:
ERROR: Failed to install 'gopkg.in/mgo.v2': exit status 1
output:
import cycle not allowed
package gopkg.in/mgo.v2
imports github.com/golang/mock/gomock
imports golang.org/x/net/context
imports github.com/golang/mock/gomock