for me as a non native speaker, I consider a specific difference between both of will and b+going to as following:
The structure BE GOING TO is normally used to indicate the future but with some type of connection to the present. Such as these situations:
1. When we have already decided or we intend to do something in the future:
They're going to retire to the beach - in fact they have already bought a little beach house.
2. When there are definite signs that something is going to happen:
I think it is going to rain - I just felt a drop.
3. When something is about to happen:
Get back! The bomb is going to explode.
When to use WILL
In other cases, where there is no implicit or explicit connection to the present, use WILL:
1. For things that we decide to do now.
I'll buy one for you too.
I think I'll try one of those. (I just decided this right now)
2. When we think or believe something about the future.
My team will not win the league this season.
I think it will rain later so take an umbrella with you.
3. To make an offer, a promise or a threat.
I'll give you a discount if you buy it right now.
I promise I will behave next time.