doc.go 1.0 KB

12345678910111213141516171819202122232425
  1. // Copyright 2019 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package xerrors implements functions to manipulate errors.
  5. //
  6. // This package supports transitioning to the Go 2 proposal for error values:
  7. // https://golang.org/design/29934-error-values
  8. //
  9. // Most of the functions and types in this package will be incorporated into the
  10. // standard library's errors package in Go 1.13; the behavior of this package's
  11. // Errorf function will be incorporated into the standard library's fmt.Errorf.
  12. // Use this package to get equivalent behavior in all supported Go versions. For
  13. // example, create errors using
  14. //
  15. // xerrors.New("write failed")
  16. //
  17. // or
  18. //
  19. // xerrors.Errorf("while reading: %v", err)
  20. //
  21. // If you want your error type to participate in the new formatting
  22. // implementation for %v and %+v, provide it with a Format method that calls
  23. // xerrors.FormatError, as shown in the example for FormatError.
  24. package xerrors // import "golang.org/x/xerrors"