It’s not easy to discern which to choose among ‘be going to’ and ‘will’ to express a near future plan or intention. I’m going to bring up two cases.
[A] In a situation that when one says “Oh, I’m hot,” while two are in the room, what can the other one say?: [A-1] I’m going to open the window. [A-2] I’ll open the window.
For ‘be going’ is concerned with ‘present intention’(CGEL,p.211-2), [A-1] seems to be possible; yet it’s also concerned with ‘present arrangement,’ it doesn’t seem to. How could I have arranged the opening window before his saying 'hot'?
However, [A-2] seems to be quite wilful to say in the situation. When it’s not a big deal to open the window, do I have to use my will? It could be said that 'will' is used in a implication that 'if you want, I will open the window'- as a conditional consequence.
How about this?:
[B] In a situation that I’ve planned that I would learn to play the guitar after deeply impressed by a guitarist, what can I say?: [B-1] I’m going to learn to play the guitar. [B-2] I will learn to play the guitar.