The superhero movie, which reportedly is dedicated to Goldstein, is due in theaters May 7.
Its director Jon Favreau told the Los Angeles Times he struggled with the decision regarding whether to leave Goldstein's scene in the movie after his death last summer of an accidental drug overdose. He was 36.
"We tried to make it respectful, and for people who know him, they'll get a kick out of it and for people who don't, it will sort of slide by without much notice," Favreau told the Times.
"I was just a fan of his, just an admirer of his work, and it was supposed to be a one-day bit," Favreau added. "But Robert (Downey Jr.) took a real shine to him, as we all did. His energy was amazing, he was such a inspiring guy and there was a lot of depth to him and this positive energy. He ended up staying on with us for about a week and it was just great; we set up this turntable and between takes he would give me pointers."
Notable deaths of 2014 [PHOTOS]