You close your temp file, to open it again? IIRC, the ioutil.TempFile provides proper os.File ...