kr / pretty

Pretty printing for Go values
http://godoc.org/github.com/kr/pretty
MIT License
1.36k stars 155 forks source link

Support fuzzy matching for floating point types #48

Open smeder opened 7 years ago

smeder commented 7 years ago

Hi,

I have a feature request: When looking for differences between structures that contain floating point numbers it is often nice to not require exact matches, i.e. one can often treat the the values as equal if they are within say 1% of each other. It would be nice if the diff interface could support this kind of fuzzy matching.