Based on discussion https://github.com/mesg-foundation/core/issues/718#issuecomment-455535167
The structhash do not support
omitempty flag. Moreover it dosen’t:
- panic on invalid tag (rather silently drop)
- https://github.com/cnf/structhash/blob/master/structhash.go#L180 - it serialize functions, channels etc … in our use case serializing channel/funcs don’t make any sens.
So we need to fix it.
Is there a reason why we using this package instead of simple json?
we can use simply
sha1.Sum(josn.Marshal(service)). End of story.
In that case we have well tested stable package and we can easily extend service struct by adding
omitempty tag to every new field.
We just need to replace tag
json and get rid of dependency.