I think the below is from the NBA definition
Goaltending -
Goaltending is a violation where a defender tries to BLOCK the ball from going into the BASKET, but the ball was on it's way down. It can also mean interferring with the ball when it's on the rim of the BASKET. If goal tending is called against the defensive team, then the offensive team automatically gets the points for the SHOT, regardless if it would go in or not. But when goaltending is called on the offensive team, the shot doesn't count and the other team gets to inbound the ball.