[go-nuts] Get a copy of reflect.Value's underlying value

2017-07-31 Thread eZio Pan
Hello, I want to build a "universal slice reverser" with reflect.MakeFunc. But I don't know how to get a copy of reflect.Value's underlying value, which make result not correct. Here is the code: package main import ( "fmt" "reflect" ) func reverse(in []reflect.Value) (out []reflect.Value) {

[go-nuts] Re: Why a []interface{} containing 2 different interface should use function like this?

2017-05-05 Thread eZio Pan
to specify the > variables types if you initialize them like you did). > > https://play.golang.org/p/pJHU0Dq8t6 > > Le vendredi 5 mai 2017 13:35:42 UTC+2, eZio Pan a écrit : >> >> Hi, I'm a newbie in Golang. I get stuck in a problem that I can't >> understand why.

[go-nuts] Re: Why a []interface{} containing 2 different interface should use function like this?

2017-05-05 Thread eZio Pan
Thank you V. I'v read this before, but it doesn't answer my question. Thank you anyway! 在 2017年5月5日星期五 UTC+8下午7:46:42,Volker Dobler写道: > > See https://golang.org/doc/faq#convert_slice_of_interface > > V. > > On Friday, 5 May 2017 13:35:42 UTC+2, eZio Pan wrote: >>

[go-nuts] Why a []interface{} containing 2 different interface should use function like this?

2017-05-05 Thread eZio Pan
Hi, I'm a newbie in Golang. I get stuck in a problem that I can't understand why. I wish someone could help me out. Thanks! There are 2 struct type *S1* and *S2*. Both of them implement interface type *StringI*. I write a function called *run* which use *StringI* interface as input, and run all