William F. Weld , the former Massachusetts governor , who once said that he would help officiate at a gay marriage ceremony , said he would veto any same-sex marriage legislation that came across his desk as governor of New York .