Skip to navigation

0.35.0

(feat): Add runtime validation for discriminated unions to prevent users from accidentally sending the wrong type of value. With this, users will be expected to set exactly one of the union’s values like so:

package example
type Animal struct {
Type string
Cat *Cat
Dog *Dog
}
func do() {
union := &Animal{
Cat: &Cat{
Name: "Fluffy",
},
}
} ```
If the user sets _both_ `Cat` and `Dog`, the user will receive an error when the type is serialized to JSON (i.e. in the `json.Marshaler` implementation).
## 0.34.0
**`(feat):`** Add support for sending the `User-Agent` header on every request. Go packages are uniquely identified by their full module path, so the `User-Agent` header is generated in the `<module>/<version>` format, e.g.
``` User-Agent: github.com/acme/acme-go/1.0.0 ```