MCPcopy Index your code
hub / github.com/yuin/gopher-lua / defaultFormat

Function defaultFormat

utils.go:30–48  ·  view source on GitHub ↗
(v interface{}, f fmt.State, c rune)

Source from the content-addressed store, hash-verified

28}
29
30func defaultFormat(v interface{}, f fmt.State, c rune) {
31 buf := make([]string, 0, 10)
32 buf = append(buf, "%")
33 for i := 0; i < 128; i++ {
34 if f.Flag(i) {
35 buf = append(buf, string(rune(i)))
36 }
37 }
38
39 if w, ok := f.Width(); ok {
40 buf = append(buf, strconv.Itoa(w))
41 }
42 if p, ok := f.Precision(); ok {
43 buf = append(buf, "."+strconv.Itoa(p))
44 }
45 buf = append(buf, string(c))
46 format := strings.Join(buf, "")
47 fmt.Fprintf(f, format, v)
48}
49
50type flagScanner struct {
51 flag byte

Callers 2

FormatMethod · 0.85
FormatMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…