goprotobuf: update to new errors.
Mostly gofix, but a few needed hand-work,
such as in the generator.
R=r, bradfitz, rsc
CC=golang-dev
http://codereview.appspot.com/5335045
diff --git a/proto/text_parser_test.go b/proto/text_parser_test.go
index 2383828..cf9d70c 100644
--- a/proto/text_parser_test.go
+++ b/proto/text_parser_test.go
@@ -259,9 +259,9 @@
// We do expect failure.
if err == nil {
t.Errorf("Test %d: Didn't get expected error: %v", i, test.error)
- } else if err.String() != test.error {
+ } else if err.Error() != test.error {
t.Errorf("Test %d: Incorrect error.\nHave: %v\nWant: %v",
- i, err.String(), test.error)
+ i, err, test.error)
}
}
}
@@ -293,7 +293,7 @@
pb := new(MyMessage)
err := UnmarshalText(benchInput, pb)
if err != nil {
- panic("Bad benchmark input: " + err.String())
+ panic("Bad benchmark input: " + err.Error())
}
}