MCPcopy
hub / github.com/tinylib/msgp / ifToStr

Function ifToStr

msgp/errors_tinygo.go:26–37  ·  view source on GitHub ↗
(i interface{})

Source from the content-addressed store, hash-verified

24}
25
26func ifToStr(i interface{}) string {
27 switch v := i.(type) {
28 case stringer:
29 return v.String()
30 case error:
31 return v.Error()
32 case string:
33 return v
34 default:
35 return reflect.ValueOf(i).String()
36 }
37}
38
39func quoteStr(s string) string {
40 return simpleQuoteStr(s)

Callers 1

ctxStringFunction · 0.85

Calls 2

StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…