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, fun
(s fmt.State, verb rune)
| 159 | // |
| 160 | // %+v Prints filename, function, and line number for each Frame in the stack. |
| 161 | func (st StackTrace) Format(s fmt.State, verb rune) { |
| 162 | switch verb { |
| 163 | case 'v': |
| 164 | switch { |
| 165 | case s.Flag('+'): |
| 166 | for _, f := range st { |
| 167 | _, _ = io.WriteString(s, "\n") |
| 168 | f.Format(s, verb) |
| 169 | } |
| 170 | case s.Flag('#'): |
| 171 | fmt.Fprintf(s, "%#v", []frame(st)) |
| 172 | default: |
| 173 | st.formatSlice(s, verb) |
| 174 | } |
| 175 | case 's': |
| 176 | st.formatSlice(s, verb) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | // formatSlice will format this StackTrace into the given buffer as a slice of |
| 181 | // Frame, only valid when called with '%s' or '%v'. |
nothing calls this directly
no test coverage detected