Haven’t used mgo much other than support it in a project, but checking the docs it appears the Collection’s Upsert method signature mentions 2 return values, a *ChangeInfo and an error, which you are trying to assign to a single value. So instead of this:
err = c.Upsert(colQuerier, item)
You should have this if you don’t need to do something with the ChangeInfo pointer:
In GoLang a function or a method can return multiple values, and when they do you have to accept it in multiple values, you can’t store two different value in single variable, i.e., if you have one string and one integer value, you need two variable one to store string value and another to store integer value.
c, d := "Hello",5 // assigns string value "Hello" to variable c, and integer value 5 to d.
fmt.Println(c, d) // will print - Hello 5
you can’t do this: d := "Hello",5 // Golang has no idea, that which values should go in variable d
Please go through some example where a function returns multiple values play with that to get the better understanding, some links : gobyexample.com, tour.golang.org
If one of the return value doesn’t matter to you, you can simply discard with underscore variable (_), which is also called blank identifier blank identifier
you can do this: _ , d := "Hello",5 // if you are not interested in "Hello" and simply want to discard
but then you won’t be able to do this: fmt.Println(_, d)