type Action string
+func (t Action) Append(child string) Action {
+ return Action(string(t) + child)
+}
+
type Error struct {
son error
Reason string
}
// Grow will append e to fe
-func Grow(fe Error, e error) Error {
+func Append(fe Error, e error) Error {
if v, ok := e.(Error); ok {
fe.son = v
} else {
var a0 = Action("a0")
var a1 = Action("a1")
+var a11 = a1.Append("1")
func TestXxx(t *testing.T) {
var err error
t.Fail()
}
- err = Grow(New("r1", a1), err)
+ err = Append(New("r1", a11), err)
- if !Catch(err, a1) {
+ if !Catch(err, a11) {
t.Fail()
}
}
func TestXxx2(t *testing.T) {
- err := Grow(New("r1", a1), io.EOF)
+ err := Append(New("r1", a1), io.EOF)
if !Catch(err, a1) {
t.Fatal()
}