> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 0.35.0

**`(feat):`** 为判别联合类型添加运行时验证，防止用户意外发送错误类型的值。使用此功能，用户需要像这样精确设置联合类型中的一个值：

**`package example`**

````go package example
type Animal struct {
  Type string
  Cat  *Cat
  Dog  *Dog
}
func do() {
  union := &Animal{
    Cat: &Cat{
      Name: "Fluffy",
    },
  }
} ```
如果用户同时设置了 `Cat` 和 `Dog`，当该类型被序列化为 JSON 时（即在 `json.Marshaler` 实现中），用户将收到错误。

## 0.34.0
**`(feat):`** 添加对在每个请求中发送 `User-Agent` 头的支持。Go 包通过其完整的模块路径唯一标识，因此 `User-Agent` 头以 `<module>/<version>` 格式生成，例如：
``` User-Agent: github.com/acme/acme-go/1.0.0 ```
````