-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeProposalerror-handlingLanguage & library change proposals that are about error handling.Language & library change proposals that are about error handling.v2An incompatible library changeAn incompatible library change
Milestone
Description
Please add into wiki Go2ErrorHandling, my proposal for error handling in error-tree. Preview:
func printSum(a, b string) error {
// create error tree
et := errors.New("check input data")
errorhandling(et interface{Add(error)}){ // add type just for clearification
x, et := strconv.Atoi(a)
y, et := strconv.Atoi(b)
}
// is error-tree have errors
if et.IsError() {
return et
}
fmt.Println("result:", x + y)
return nil
}
In detail see: Go2ErrorTree
Konstantin8105tmthrgd and griesemer
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeProposalerror-handlingLanguage & library change proposals that are about error handling.Language & library change proposals that are about error handling.v2An incompatible library changeAn incompatible library change