I'm trying to write a function that can accept a pointer to a struct of unknown type (via interface{}) and a *database/sql.Rows, and copy the values from the current cursor in the sql.Rows into fields of the struct with corresponding names, using reflection. It might be that what I'm trying to do isn't really feasible in Go, but I think it's more likely that I'm just too much of a n00b to know how.First I tried making the destination input to the function type *interface{}, but apparently that's not allowed. Then I tried just passing a pointer in to a parameter of type interface{} and then dereferencing it into another interface{} variable to examine with reflect, but apparently you can't dereference a variable of type interface{} unless you use a type assertion to cast it to a definite pointer type (which of course I can't do because I don't know what type of struct it will be pointing to until runtime). Is there a way to do what I'm trying to do with structs?--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.