R=r
DELTA=5 (3 added, 0 deleted, 2 changed)
OCL=27371
CL=27389
// FormatterMap is the type describing the mapping from formatter
// names to the functions that implement them.
+// TODO(rsc): Maybe func should take interface{} instead?
type FormatterMap map[string] func(reflect.Value) string
// Built-in formatters.
}
val := t.varValue(name);
// is it in user-supplied map?
- if fn, ok := t.fmap[formatter]; ok {
- return fn(val)
+ if t.fmap != nil {
+ if fn, ok := t.fmap[formatter]; ok {
+ return fn(val)
+ }
}
// is it in builtin map?
if fn, ok := builtins[formatter]; ok {