瀏覽代碼

document extended format

Dave Cheney 9 年之前
父節點
當前提交
9a4f977a05
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      errors.go

+ 11 - 0
errors.go

@@ -43,6 +43,17 @@
 //             // unknown error
 //     }
 //
+// Formatted printing of errors
+//
+// All error values returned from this package implement fmt.Formatter and can
+// be formatted by the fmt package. The following verbs are supported
+//
+//     %s    print the error. If the error has a Cause it will be
+//           printed recursively
+//     %v    see %s
+//     %+v   extended format. Each Frame of the error's Stacktrace will
+//           be printed in detail.
+//
 // Retrieving the stack trace of an error or wrapper
 //
 // New, Errorf, Wrap, and Wrapf record a stack trace at the point they are