Sfoglia il codice sorgente

Add doc comment for exported Format func (#115)

Matthew Hardwick 8 anni fa
parent
commit
c605e284fe
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      stack.go

+ 8 - 0
stack.go

@@ -79,6 +79,14 @@ func (f Frame) Format(s fmt.State, verb rune) {
 // StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
 type StackTrace []Frame
 
+// Format formats the stack of Frames according to the fmt.Formatter interface.
+//
+//    %s	lists source files for each Frame in the stack
+//    %v	lists the source file and line number for each Frame in the stack
+//
+// Format accepts flags that alter the printing of some verbs, as follows:
+//
+//    %+v   Prints filename, function, and line number for each Frame in the stack.
 func (st StackTrace) Format(s fmt.State, verb rune) {
 	switch verb {
 	case 'v':