ALL LANGUAGES SHOULD LOOK LIKE C#))) If you are still there then.. don't worry it's a joke) But many a true word is spoken in jest. This repository was made for fun. I don't want to get some lib which will be used in some real systems making this project. My advise: DON'T USE IT IN REAL PROJECTS :).
It's possible to try use try-catch:
Try(func() {
fmt.Println("Hello Try! Let's get some fun!")
RaiseError(&Error{"Oh no! something went wrong! Let's get out of here!!!"})
}).
Catch(func(err *Error) {
fmt.Println("Hehe... So good we have Catch there.")
}).
Finally(func(){
fmt.Println("Roll up, time to go home.")
}).
Do()
Just go get
this repository with the following way:
go get github.com/alexpantyukhin/go-try-catch