We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using diff between maps with uint as key type, returns a path without the key value.
Following code prints: "[{delete [items ] 2 } {delete [items ] 3 }]"
type Order struct { ID string `diff:"id"` Items map[uint]uint `diff:"items"` } func main() { a := Order{ ID: "1234", Items: map[uint]uint{10: 1, 20: 2, 30: 3, 40: 4}, } b := Order{ ID: "1234", Items: map[uint]uint{10: 1, 40: 4}, } changelog, err := diff.Diff(a, b) if err != nil { fmt.Println("error") } else { fmt.Println(changelog) }
The text was updated successfully, but these errors were encountered:
func idstring(v interface{}) string { switch v.(type) { case string: return v.(string) case int: return strconv.Itoa(v.(int)) default: return "" } }
why did you avoid to add more types to the function? seems like the problem
Sorry, something went wrong.
Thanks for raising the issue!
This should now be fixed on master.
No branches or pull requests
Using diff between maps with uint as key type, returns a path without the key value.
Following code prints:
"[{delete [items ] 2 } {delete [items ] 3 }]"
The text was updated successfully, but these errors were encountered: