MCPcopy
hub / github.com/op/go-logging / MustStringFormatter

Function MustStringFormatter

format.go:262–268  ·  view source on GitHub ↗

MustStringFormatter is equivalent to NewStringFormatter with a call to panic on error.

(format string)

Source from the content-addressed store, hash-verified

260// MustStringFormatter is equivalent to NewStringFormatter with a call to panic
261// on error.
262func MustStringFormatter(format string) Formatter {
263 f, err := NewStringFormatter(format)
264 if err != nil {
265 panic("Failed to initialized string formatter: " + err.Error())
266 }
267 return f
268}
269
270func (f *stringFormatter) add(verb fmtVerb, layout string) {
271 f.parts = append(f.parts, part{verb, layout})

Callers 9

TestRealFuncFormatFunction · 0.85
TestStructFuncFormatFunction · 0.85
TestVarFuncFormatFunction · 0.85
TestBackendFormatterFunction · 0.85
BenchmarkStringFormatterFunction · 0.85
TestLogCalldepthFunction · 0.85
testCallpathFunction · 0.85
ExampleFunction · 0.85
format.goFile · 0.85

Calls 2

NewStringFormatterFunction · 0.85
ErrorMethod · 0.80

Tested by 8

TestRealFuncFormatFunction · 0.68
TestStructFuncFormatFunction · 0.68
TestVarFuncFormatFunction · 0.68
TestBackendFormatterFunction · 0.68
BenchmarkStringFormatterFunction · 0.68
TestLogCalldepthFunction · 0.68
testCallpathFunction · 0.68
ExampleFunction · 0.68