aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/template/funcs.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-12-03 02:17:34 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-12-03 02:17:34 +0000
commit2fd401c8f190f1fe43e51a7f726f6ed6119a1f96 (patch)
tree7f76eff391f37fe6467ff4ffbc0c582c9959ea30 /libgo/go/template/funcs.go
parent02e9018f1616b23f1276151797216717b3564202 (diff)
downloadgcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.zip
gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.gz
gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.bz2
libgo: Update to weekly.2011-11-02.
From-SVN: r181964
Diffstat (limited to 'libgo/go/template/funcs.go')
-rw-r--r--libgo/go/template/funcs.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/libgo/go/template/funcs.go b/libgo/go/template/funcs.go
index 938559e..26c3a6e 100644
--- a/libgo/go/template/funcs.go
+++ b/libgo/go/template/funcs.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "os"
"reflect"
"strings"
"unicode"
@@ -18,7 +17,7 @@ import (
// FuncMap is the type of the map defining the mapping from names to functions.
// Each function must have either a single return value, or two return values of
-// which the second has type os.Error. If the second argument evaluates to non-nil
+// which the second has type error. If the second argument evaluates to non-nil
// during execution, execution terminates and Execute returns an error.
type FuncMap map[string]interface{}
@@ -69,7 +68,7 @@ func addFuncs(out, in FuncMap) {
// goodFunc checks that the function or method has the right result signature.
func goodFunc(typ reflect.Type) bool {
- // We allow functions with 1 result or 2 results where the second is an os.Error.
+ // We allow functions with 1 result or 2 results where the second is an error.
switch {
case typ.NumOut() == 1:
return true
@@ -102,7 +101,7 @@ func findFunction(name string, tmpl *Template, set *Set) (reflect.Value, bool) {
// index returns the result of indexing its first argument by the following
// arguments. Thus "index x 1 2 3" is, in Go syntax, x[1][2][3]. Each
// indexed item must be a map, slice, or array.
-func index(item interface{}, indices ...interface{}) (interface{}, os.Error) {
+func index(item interface{}, indices ...interface{}) (interface{}, error) {
v := reflect.ValueOf(item)
for _, i := range indices {
index := reflect.ValueOf(i)
@@ -144,7 +143,7 @@ func index(item interface{}, indices ...interface{}) (interface{}, os.Error) {
// Length
// length returns the length of the item, with an error if it has no defined length.
-func length(item interface{}) (int, os.Error) {
+func length(item interface{}) (int, error) {
v, isNil := indirect(reflect.ValueOf(item))
if isNil {
return 0, fmt.Errorf("len of nil pointer")