mishudark / eventhus

Go - CQRS / Event Sourcing made easy - Go
MIT License
465 stars 92 forks source link

assignment mismatch for badger (but not using badger) #13

Closed lowewenzel closed 5 years ago

lowewenzel commented 5 years ago

Currently trying to use this library gives me this error when running:

# github.com/mishudark/eventhus/eventstore/badger
../../../go/src/github.com/mishudark/eventhus/eventstore/badger/badger.go:120:12: assignment mismatch: 2 variables but item.Value returns 1 values
../../../go/src/github.com/mishudark/eventhus/eventstore/badger/badger.go:120:25: not enough arguments in call to item.Value
    have ()
    want (func([]byte) error)
../../../go/src/github.com/mishudark/eventhus/eventstore/badger/badger.go:175:22: assignment mismatch: 2 variables but item.Value returns 1 values
../../../go/src/github.com/mishudark/eventhus/eventstore/badger/badger.go:175:35: not enough arguments in call to item.Value
    have ()
    want (func([]byte) error)

What's interesting is that when I try to run the example bank application from a cloned github repo, it works fine. But if I separate the example from the repo folder or make my own implementation, I constantly get this error.

lowewenzel commented 5 years ago

Maybe related @toesterdahl's PR #10? I'm not touching badger at all

mishudark commented 5 years ago

Hello, are you using go modules?

lowewenzel commented 5 years ago

@mishudark just the normal go get github.com/mishudark/eventhus

mishudark commented 5 years ago

actually, if you perform go get github.com/mishudark/eventhus it will download the master branch of every dependency, in this case, badger on the master branch is in v2 RC1 state, the solution should be activated gomod in order to use the predefined versions used by eventhus

GO111MODULE=on
go get github.com/mishudark/eventhus
lowewenzel commented 5 years ago

Still no luck :/

I moved the bank example out of the examples folder to test this, getting the same error. Also tried removing the packages from my GOPATH and then reinstalling then.

mishudark commented 5 years ago

what go version are you using? go version

lowewenzel commented 5 years ago

go version go1.12.3 darwin/amd64

mishudark commented 5 years ago

sorry, I miss to put export in the previous example, could you try again, please ?

export GO111MODULE=on
go get github.com/mishudark/eventhus
lowewenzel commented 5 years ago

This worked! Thank you!