* 'Axel Wagner' via golang-nuts [200917 12:05]:
> I think you might've intended this, which does indeed print true:
> type S []S
> var a, b S
> a, b = S{0: b}, S{0: a}
> fmt.Println(reflect.DeepEqual(a, b))
I was guessing he meant:
type S []S
var a, b S
a = S{0: b}
b = S{0: a}
Aha, you are totally right.
I made silly mistake here. ;D
On Thursday, September 17, 2020 at 12:05:31 PM UTC-4
axel.wa...@googlemail.com wrote:
> I think you might've intended this, which does indeed print true:
> type S []S
> var a, b S
> a, b = S{0: b}, S{0: a}
> fmt.Println(reflect.DeepEqua
Aha, you are totally wrong.
I made silly mistake here. ;D
On Thursday, September 17, 2020 at 12:05:31 PM UTC-4
axel.wa...@googlemail.com wrote:
> I think you might've intended this, which does indeed print true:
> type S []S
> var a, b S
> a, b = S{0: b}, S{0: a}
> fmt.Println(reflect.DeepEqual
I think you might've intended this, which does indeed print true:
type S []S
var a, b S
a, b = S{0: b}, S{0: a}
fmt.Println(reflect.DeepEqual(a, b))
On Thu, Sep 17, 2020 at 6:03 PM Axel Wagner
wrote:
> I don't think the docs imply that. For one, a[0] is nil, and b[0] isn't.
>
> On Thu, Sep 17,
I don't think the docs imply that. For one, a[0] is nil, and b[0] isn't.
On Thu, Sep 17, 2020 at 5:58 PM tapi...@gmail.com
wrote:
>
> package main
>
> import (
> "fmt"
> "reflect"
> )
>
> func main() {
> f()
> }
>
> func f() {
> type S []S
> var a, b S
> a = S{0: b}
> b = S{0: a}
>
package main
import (
"fmt"
"reflect"
)
func main() {
f()
}
func f() {
type S []S
var a, b S
a = S{0: b}
b = S{0: a}
fmt.Println(reflect.DeepEqual(a, b))
}
Now it prints false. But it looks the docs indicates it should print true.
--
You received this message because you are