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.DeepEqual(a, b))
>
> On Thu, Sep 17, 2020 at 6:03 PM Axel Wagner <axel.wa...@googlemail.com> 
> wrote:
>
>> 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 <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}
>>>   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 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.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/dbe73874-ec0f-413d-bed6-47f213bede91n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/golang-nuts/dbe73874-ec0f-413d-bed6-47f213bede91n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4b085282-3124-4c6e-9da4-ee4d10dbfae8n%40googlegroups.com.

Reply via email to