1
0
mirror of https://github.com/golang/go synced 2024-10-04 22:21:22 -06:00
go/src/lib/template/format.go

28 lines
779 B
Go
Raw Normal View History

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Template library: default formatters
package template
import (
"fmt";
"io";
"reflect";
)
// HtmlFormatter formats arbitrary values for HTML
// TODO: do something for real.
func HtmlFormatter(w io.Write, value interface{}, format string) {
fmt.Fprint(w, value);
}
// StringFormatter formats into the default string representation.
// It is stored under the name "str" and is the default formatter.
// You can override the default formatter by storing your default
// under the name "" in your custom formatter map.
func StringFormatter(w io.Write, value interface{}, format string) {
fmt.Fprint(w, value);
}