Understand error

Hello,

i’m using go to update many data in a mongo database. I have one error but i amn’t able to resolve it.

panic: (*mgo.ChangeInfo) (0x1171240,0xc42006d020)

My code is this one : err, _ := ;sessionCopy.DB(mongodb_database).C(mongodb_collection).UpdateAll(selectedItem,changeset)

How understand those error code ?

Thanks

Look at the signature of this method:

func (c *Collection) UpdateAll(selector interface{}, update interface{}) (info *ChangeInfo, err error)

You receive ChangeInfo in you err variable and you ignore the returned error. I would say your code works, just do “ui, err :=“ and not “err, _ :=“.

i didn’t focus on the good problem, thanks a lot !

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.