Skip to content

Golang alternative to Try/Catch/Throw exceptions

Notifications You must be signed in to change notification settings

Vallium/fair-catch-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Fair Catch

Fair Catch is a package provides a golang alternative to Try/Catch/Throw exceptions you can find in other languages like C++, C#, Java, ...

It uses the built-in function Recover that regains control of a panicking goroutine.

A little bit of general knowledge

A fair catch is a feature of American football and several other codes of football, in which a player attempting to catch a ball kicked by the opposing team – either on a kickoff or punt – is entitled to catch the ball without interference from any member of the kicking team. A ball caught in this manner becomes dead once caught, i.e., the player catching the ball is not entitled to run with the ball in an attempt to gain yardage, and the receiving team begins its drive at the spot where the ball was caught. A player wishing to make a fair catch signals his intent by extending one arm above his head and waving it while the kicked ball is in flight. The kicking team must allow the player an opportunity to make the catch without interference.

The primary reason for the fair catch rule is to protect the receiver. A receiver directs his attention toward the incoming punt and cannot focus on the defenders running towards him. He is quite vulnerable to injury and is also at risk for fumbling or muffing the kicked ball if the punter intentionally makes a high short kick to allow defenders time to hit the receiver. A second reason for a fair catch, on a punted ball, is to prevent the ball from rolling toward the receiving team's goal and being downed deep in the team's own territory.

Source: Wikipedia

About

Golang alternative to Try/Catch/Throw exceptions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages