coopernurse/gorp — pull request #47 by robfig (2013-05-24 13:41:29+00:00)
Title: Improve error message when user attempts to select into a non-pointer slice.

If user passes a type of []*Struct instead of *[]*Struct, tell them so.

Tested by changing this line in gorp_test.go:

var puArr []*PersistentUser
_, err = dbmap.Select(&puArr, "select * from PersistentUser")

to

var puArr []*PersistentUser
_, err = dbmap.Select(puArr, "select * from PersistentUser")

and observing this error message on test failure:

panic: gorp: Cannot SELECT into a non-pointer slice: []*gorp_test.PersistentUser