Well, gold is a metal. And it would be one of the worst materials to make a gun with. It is heavy, and very soft. It can't handle the pressure of firing.
Can a weapon be made of gold?
Yes, but not practical. You could produce all the parts, of course, but gold, even gold alloys, are far too soft and the resulting weapon would rapidly fail or even blow up depending on the round it was chambered for. It's very easy to gold-plate firearms as noted.
Can the Golden Gun Work?
So yes, 18 Karat gold can technically stand up to the abuse of being the parts of a gun that would actually be fired. However, a higher strength means lower ductility, which in turn means that the material would not be able to absorb a lot of force before breaking or even shattering.