Go `sqlmock` from Data Dog can be useful for making sure you know exactly which queries are being sent to the DB. But it has a limited set of type matchers and when matchers don't match, it's so hard to figure out what was actually sent. It supports custom matchers.

I figured out a little pattern I like there I pass `t` from the test (`testing.T`) into the custom matcher's struct and then use `t.Log()` to pass back what the heck was wrong with the value passed. So many WTFs saved when tests fail. #Golang

type MicrosTimestamp struct {
    t *testing.T
}
func (r MicrosTimestamp) Match(v driver.Value) bool {
 i, ok := v.(int64)
    if !ok {
        r.t.Log(fmt.Sprintf("TESTS: MicrosTimestamp got %v which is not an int64", v))
        return false
    }
...