aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/exp/template/html/escape_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/exp/template/html/escape_test.go')
-rw-r--r--src/pkg/exp/template/html/escape_test.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/pkg/exp/template/html/escape_test.go b/src/pkg/exp/template/html/escape_test.go
index 1b3b256733..20599bce15 100644
--- a/src/pkg/exp/template/html/escape_test.go
+++ b/src/pkg/exp/template/html/escape_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"json"
- "os"
"strings"
"template"
"template/parse"
@@ -17,14 +16,14 @@ import (
type badMarshaler struct{}
-func (x *badMarshaler) MarshalJSON() ([]byte, os.Error) {
+func (x *badMarshaler) MarshalJSON() ([]byte, error) {
// Keys in valid JSON must be double quoted as must all strings.
return []byte("{ foo: 'not quite valid JSON' }"), nil
}
type goodMarshaler struct{}
-func (x *goodMarshaler) MarshalJSON() ([]byte, os.Error) {
+func (x *goodMarshaler) MarshalJSON() ([]byte, error) {
return []byte(`{ "<foo>": "O'Reilly" }`), nil
}
@@ -783,7 +782,7 @@ func TestEscapeSet(t *testing.T) {
// pred is a template function that returns the predecessor of a
// natural number for testing recursive templates.
- fns := template.FuncMap{"pred": func(a ...interface{}) (interface{}, os.Error) {
+ fns := template.FuncMap{"pred": func(a ...interface{}) (interface{}, error) {
if len(a) == 1 {
if i, _ := a[0].(int); i > 0 {
return i - 1, nil
@@ -807,7 +806,7 @@ func TestEscapeSet(t *testing.T) {
var b bytes.Buffer
if err := s.Execute(&b, "main", data); err != nil {
- t.Errorf("%q executing %v", err.String(), s.Template("main"))
+ t.Errorf("%q executing %v", err.Error(), s.Template("main"))
continue
}
if got := b.String(); test.want != got {
@@ -962,7 +961,7 @@ func TestErrors(t *testing.T) {
}
for _, test := range tests {
- var err os.Error
+ var err error
if strings.HasPrefix(test.input, "{{define") {
var s template.Set
_, err = s.Parse(test.input)
@@ -977,7 +976,7 @@ func TestErrors(t *testing.T) {
}
var got string
if err != nil {
- got = err.String()
+ got = err.Error()
}
if test.err == "" {
if got != "" {
@@ -1549,7 +1548,7 @@ func TestEnsurePipelineContains(t *testing.T) {
}
}
-func expectExecuteFailure(t *testing.T, b *bytes.Buffer, err os.Error) {
+func expectExecuteFailure(t *testing.T, b *bytes.Buffer, err error) {
if err != nil {
if b.Len() != 0 {
t.Errorf("output on buffer: %q", b.String())