MCPcopy
hub / github.com/duke-git/lancet / Format

Method Format

xerror/stack.go:161–178  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

159//
160// %+v Prints filename, function, and line number for each Frame in the stack.
161func (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'.

Callers

nothing calls this directly

Calls 2

formatSliceMethod · 0.95
FormatMethod · 0.45

Tested by

no test coverage detected