Closed JordanDeBeer closed 4 years ago
This PR probably needs another test or two based on some work I was doing utilizing the UnmarshalJSON method. Going to see what I can do about writing those and then re-open.
I would prefer not to add JSON methods to this package. I don't see this being a particularly common use case and would rather have callers create their own JSON representation, or possibly use something like the upcoming registration methods: https://github.com/golang/go/issues/5901
Thanks for your time, but I'd rather not pursue this.
This PR makes working with JSON in this library a bit easier.
Firstly, it adds json tags to each struct in wgtypes so that they are serialized to json in a more "json-esque" format.
Secondly, it adds a custom UnmarshalJSON method for wgtypes.Key so that they can be read from JSON.