On Wed, Dec 16, 2020 at 7:34 AM xie cui <cuiwei...@gmail.com> wrote: > https://github.com/golang/go/blob/master/src/reflect/type.go#L315 > is this equal func generate by compiler, >
Yes, or by `reflect`. > so where can i find the code generate this func? > >From what I can tell: https://github.com/golang/go/blob/75e16f5127eb6affb4b473c93565a8d29a802e51/src/cmd/compile/internal/gc/alg.go#L454 > what is the rule for compare two object of same struct? > It's in the spec: https://golang.org/ref/spec#Comparison_operators > Struct values are comparable if all their fields are comparable. Two struct values are equal if their corresponding non-blank fields are equal. > -- > 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/d43edfbf-87c0-4cd2-bf02-0e4c8251edabn%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/d43edfbf-87c0-4cd2-bf02-0e4c8251edabn%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/CAEkBMfG7zGb-56tkh-t%3DJr1sskAtS-Ci4BqPUZEYepKUjebBGg%40mail.gmail.com.