Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

having issue in item.Value() in blockchain/blockchain.go #5

Open
laibleeds opened this issue Feb 9, 2021 · 1 comment
Open

having issue in item.Value() in blockchain/blockchain.go #5

laibleeds opened this issue Feb 9, 2021 · 1 comment

Comments

@laibleeds
Copy link

image
i can not resolve the error here, which says " cannot assign 1 values to 2 variables" & "too few arguments in call to item.Value"

please help me out with it, currently i'm using go version 1.15.8 on VScode

@rishikeshkchapekar
Copy link

rishikeshkchapekar commented Feb 16, 2021

I had the same problem. It seems BadgerDB Go package has updated since the video series was published, and the item.Value() syntax has changed

So I looked up the Badger docs, and fixed the code according to the latest version. So now the code looks this:

var encodedBlock []byte
err = item.Value(func(val []byte) error{
	encodedBlock = val
	return nil
})

You can see the latest docs here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants