"will" is usually used in this occasion that when people want to do something while he didn't had planed to before.
"be going to" is different. it means something that we had planed to do. the decision has already be made.
ex: there is going to be a party tonight,but i will not go to,because i have some emergency to deal with.
this is a small difference between them,in most cases we could use both of them.