Use reflect.DeepEqual instead of == to compare structs with slices because == only checks memory addresses.
You cannot use == to compare structs containing slices because slices are reference types that compare by pointer address, not content. Use reflect.DeepEqual or a custom function to compare the actual data inside the slices.
import "reflect"
if reflect.DeepEqual(a, b) {
// Structs are equal
}
Comparing structs with == fails if they contain slices because the operator checks if the two slices point to the exact same memory location, not if they hold the same data. Think of it like comparing two shopping lists: == checks if you are holding the exact same physical paper, whereas DeepEqual checks if the items written on both papers are identical. You need DeepEqual to verify the contents match.