suyashkumar / dicom

⚡High Performance DICOM Medical Image Parser in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Explore Lint based or reflection based tests for struct equality changes

suyashkumar opened this issue · comments

In #280, we introduced Equals() methods for most Dataset related structs, which greatly reduces time to check for equality of large datasets (useful in tests and elsewhere) vs. relying on reflection. However, we must take care that if these structs are modified, the Equals method is also updated. These structs should not change often, so enforcing it at code review for now and this isn't a super high priority. But one could imagine lint comment based rules to check for this or reflection based tests to autogenerate a small set of equal and unequal values for every struct field (and those would fail if a newly added struct field wasn't reflected in the Equals method).