Structural and electronic properties of gold nanowires