xerrors

command
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 3 Imported by: 0

README

xerrors 示例

演示 Genesis xerrors 包的用法。

运行

cd examples/xerrors
go run main.go

内容

  1. Wrap/Wrapf - 错误包装,保留错误链
  2. Sentinel Errors - 自定义哨兵错误 + errors.Is() 检查
  3. WithCode/GetCode - 机器可读的错误码
  4. Collector - 收集第一个错误(适合表单验证)
  5. Combine - 合并多个错误
  6. Must - 初始化时使用,运行时勿用

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL