MCPcopy Index your code
hub / github.com/pkg/errors / Format

Method Format

stack.go:107–124  ·  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, functi

(s fmt.State, verb rune)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

formatSliceMethod · 0.95
FormatMethod · 0.45

Tested by

no test coverage detected