Goldman Sachs has seen two employees test positive for COVID-19 in the last two weeks — just as the megabank has begun to prod workers back into the office, sources told The Post.

One of the cases appears to have affected Goldman’s trading operation, and the bank has sent some workers in that division home to quarantine, sources said. The other works at Goldman’s back-office division, known to Goldman insiders as “The Federation,” sources said. The two workers are on different floors.

Goldman Chief Executive David Solomon and his executive leadership team have recently begun to accelerate their “return to office” plan, which aims to get staff out of their sweatpants and back into their cubicles after six months of pandemic-enforced working from home.

On Sept. 9, Goldman circulated a memo to all staff alerting them to a rotational plan that would put limited amounts of people at desks to maximize social distancing. In that memo, Solomon alluded to the possibility of future positive cases, writing “The future remains uncertain, requiring us to stay nimble and pivot as needed.”

One of the positive tests occurred before the Sept. 9 memo. Neither case appears to have been contracted at Goldman’s headquarters at 200 West St. in lower Manhattan, and there have been no other positive cases related to the two infected workers, according to a source close to the situation.

The news echoes a similar announcement earlier this week from JPMorgan Chase, which notified workers in its equity trading group that one of their co-workers had tested positive for the deadly virus just days after telling senior trading executives they needed to return to their offices on Sept. 21.

Wall Street is broadly reckoning with how to safely get people back at their desks, and that is especially true of traders. Successful trading floors thrive on speed, and many big banks have spent the last decade implementing risk and compliance infrastructure to their trading floors that are impossible to replicate with people working remotely.

A Goldman spokesperson indicated that the $2 trillion bank’s plan to get people back in the office will proceed.

Our people’s safety is our first priority and we are taking appropriate precautions to make sure our workplaces remain safe for those who choose to return,” the spokesman said.