- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for printableValue (0.13 sec)
-
src/text/template/exec.go
s.at(n) iface, ok := printableValue(v) if !ok { s.errorf("can't print %s of type %s", n, v.Type()) } _, err := fmt.Fprint(s.wr, iface) if err != nil { s.writeError(err) } } // printableValue returns the, possibly indirected, interface value inside v that // is best for a call to formatted printer. func printableValue(v reflect.Value) (any, bool) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 21:22:24 UTC 2024 - 32K bytes - Viewed (0) -
src/text/template/funcs.go
func evalArgs(args []any) string { ok := false var s string // Fast path for simple common case. if len(args) == 1 { s, ok = args[0].(string) } if !ok { for i, arg := range args { a, ok := printableValue(reflect.ValueOf(arg)) if ok { args[i] = a } // else let fmt do its thing } s = fmt.Sprint(args...) } return s
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 22:23:55 UTC 2024 - 20.9K bytes - Viewed (0)