North Carolina Gov. Pat McCrory (R) warned his attorney general that he should not publicize his personal opposition to the state’s new voter identification laws while also defending them in a lawsuit brought up by the Justice Department.

“Regarding the attorney general, my only comment regarding this is he can have his personal opinion but as a lawyer he should not publicize your personal opinion if you’re going to be defending the people who are promoting this commonsense law,” McCrory said during an appearance at The Heritage Foundation on Monday. “Good lawyers don’t do that.”

Roy Cooper (D) is in an awkward position as attorney general. He is planning to run for governor in 2016 but he will also represent his state in a lawsuit brought by the Justice Department over North Carolina’s strict new voter identification laws. The state also faces a lawsuit over an amendment to the North Carolina constitution that bars same-sex marriage. He has been critical of the voter identification law and said he favors legalizing same-sex marriage.

McCrory, who hasn’t yet said whether he’s running for re-election, has been an ardent supporter of the new voter identification laws, saying they simply close loopholes in the state’s voting system. The Justice Department, meanwhile, argues that the law is aimed at preventing minorities from voting.