Message about deprecation of `xerrors.Errorf` may confuse people because
they will think that `fmt.Errorf` will work the same way. In fact,
fmt.Errorf will not capture a stack backtrace.

Change-Id: I912f6b2ef289e97e69fe21160af62ba1ef4aa0a5
GitHub-Last-Rev: 16289f933c
GitHub-Pull-Request: golang/xerrors#3
Reviewed-on: https://go-review.googlesource.com/c/xerrors/+/410314
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Pavel @grbit Gryaznov 2022-06-08 20:28:37 +00:00 коммит произвёл Gopher Robot
Родитель f3a8303e98
Коммит 65e65417b0
1 изменённых файлов: 2 добавлений и 1 удалений

3
fmt.go
Просмотреть файл

@ -34,7 +34,8 @@ const percentBangString = "%!"
// operand that does not implement the error interface. The %w verb is otherwise
// a synonym for %v.
//
// Deprecated: As of Go 1.13, use fmt.Errorf instead.
// Note that as of Go 1.13, the fmt.Errorf function will do error formatting,
// but it will not capture a stack backtrace.
func Errorf(format string, a ...interface{}) error {
format = formatPlusW(format)
// Support a ": %[wsv]" suffix, which works well with xerrors.Formatter.