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, functi
(s fmt.State, verb rune)
| 105 | // |
| 106 | // %+v Prints filename, function, and line number for each Frame in the stack. |
| 107 | func (st StackTrace) Format(s fmt.State, verb rune) { |
| 108 | switch verb { |
| 109 | case 'v': |
| 110 | switch { |
| 111 | case s.Flag('+'): |
| 112 | for _, f := range st { |
| 113 | io.WriteString(s, "\n") |
| 114 | f.Format(s, verb) |
| 115 | } |
| 116 | case s.Flag('#'): |
| 117 | fmt.Fprintf(s, "%#v", []Frame(st)) |
| 118 | default: |
| 119 | st.formatSlice(s, verb) |
| 120 | } |
| 121 | case 's': |
| 122 | st.formatSlice(s, verb) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | // formatSlice will format this StackTrace into the given buffer as a slice of |
| 127 | // Frame, only valid when called with '%s' or '%v'. |
nothing calls this directly
no test coverage detected