Closed robbinhan closed 3 years ago
Hi @robbinhan , thanks for submitting this contribution!
Tests are failing for your PR as this changes the behaviour of diffing slices for all use cases.
I'm not sure if that change is actually necessary, as there is already diff.SliceOrdering()
, which should produce more or less the same result?
func main() {
a := []string{"web.business.image/202009165d0d6aeb03ec6ecb494897d8", "web.business.image/202009045d0d1788b05942ca42988dca"}
b := []string{"web.business.image/202009045d0d1788b05942ca42988dca", "web.business.image/202009165d0d6aeb03ec6ecb494897d8"}
cl, _ := diff.Diff(a, b)
// produces '[]'
fmt.Println(cl)
cl, _ = diff.Diff(a, b, diff.SliceOrdering(true))
// produces: '[{update [0] web.business.image/202009165d0d6aeb03ec6ecb494897d8 web.business.image/202009045d0d1788b05942ca42988dca <nil>} {update [1] web.business.image/202009045d0d1788b05942ca42988dca web.business.image/202009165d0d6aeb03ec6ecb494897d8 <nil>}]'
fmt.Println(cl)
}
ok,I will try again
fix index exchange diff error
no index will output type :