A common mistake is assuming that values stored in any are always safely comparable. Equality can compile, then panic at runtime when the dynamic value is a struct containing a slice. section 3.13
Comparing a customer with a slice
Two customer values containing identical operations slices cannot be compared with ==. Assigning them to any moves the failure from compile time to a runtime panic. Use reflect.DeepEqual for recursive comparison, or write customer.equal when the comparison needs explicit rules. DeepEqual distinguishes nil and empty collections, so choose it deliberately. section 3.13
cust1 := customer{id: "x", operations: []float64{1.}}
cust2 := customer{id: "x", operations: []float64{1.}}
fmt.Println(reflect.DeepEqual(cust1, cust2))
Run the DeepEqual example to see a customer containing a slice compare successfully. section 3.13












