If only one member of the attacking team can go for the ball, and they are in an offside position, experienced referees will whistle immediately to avoid the goalkeeper/attacker contact.
Similar situation arises when a winger chases the ball along the touchline, with no other attackers able to...