I need to append a value to a slice of an unknown type. The slice is
passed into a function as an empty interface, and I can use the reflect
package to deal with it. However I can't figure out how to get the value
I'm working to be the pointer of the slice as opposed to copying it.
See this example:
I've tried passing in the slice's pointer, but that doesn't work. I can't
get the appended value back out to the original slice.
I've tried copying the val.Interface() back into the slice at the end of
the function, but that doesn't work as well.
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 email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.