Actually, it depends on different understandings of the word "good", though gramatically both answers are not wrong.
It is goodfor you to ...------it will do you good to ... (beneficial for yourself)
It is goodof you to ...------it is nice/kind of you to ... (from the point of your character)
I'm thinking this way, still not sure.