SAN FRANCISCO — Hampered for much of the season by a balky elbow, Mets lefthander Steven Matz was scratched from his scheduled start against the Giants on Friday night with lingering discomfort in his shoulder.

Said Matz: “It’s just discomfort . . . I’m really not worried about it.”

With the Mets clawing to stay in the wild-card race, rookie Seth Lugo will take the mound in place of Matz, who is holding out hope that skipping one turn through the rotation will be enough to quell his shoulder issue. He will receive treatment on Friday, and there are no plans yet to send him to New York for further testing.

“It’s definitely frustrating,” said Matz, whose start was scratched after the Mets’ 10-7 loss to the Giants on Thursday night. “I’m definitely not happy about it. My elbow was feeling good. I felt like I got myself into a good routine.”

Matz, 25, has been pitching through a painful bone spur in his elbow, though his results have steadily improved. He was coming off a gem on Sunday, when he tossed 7 1⁄3 shutout innings to beat the Padres after taking a no-hitter into the eighth.

advertisement | advertise on newsday

But two days after pitching, the Long Island native experienced discomfort while throwing a curveball on flat ground. He skipped his scheduled bullpen session, a common practice for pitchers late in the season, but the discomfort did not improve.

“I felt a little twinge in my shoulder,” he said. “It was bothering me a little bit.”

Matz threw off flat ground before the game on Thursday night and reported no improvement, prompting the Mets to hold Lugo and Erik Goeddel out of a game in which starter Jacob deGrom went only five innings.

“It happened again today,” Terry Collins said. “So we just said we’ve got to as a precaution get him seen and certainly skip him this time.”

Lugo last pitched in relief on Wednesday, tossing 1 1⁄3 scoreless innings against the Diamondbacks. The injury comes with the Mets already strapped for depth and struggling on the mound.

Mets videos

In the first four games of the road trip, the Mets have allowed 38 runs, and an absence from Matz (9-8 3.40 ERA) won’t help.

“It’s a hole,” Collins said. “But you’ve got to do what’s right, and what’s right is to make sure this kid down the road is going to be healthy.”

It’s unclear whether Matz’s shoulder issue is linked to the elbow problem he has been battling. The Mets resolved to monitor Matz’s mechanics closely for fear that changing them because of the bone spur in his elbow might trigger issues elsewhere in his arm.

Collins said the Mets are confident in data from the Trackman system used at Citi Field, which has detected no mechanical changes, a positive sign in the long term. In the short term, however, the Mets will be forced to deal with another injury to a key player.

Said Collins: “The hits just keep on coming.”