As Walt said, lacquer was commonly used and it would have been sprayed on. Low end, mass produced guns still retaining some original factory finish will often have it flaking off.

I've seen reference in pre-WWII gun advertisements to "Duco finish."

Duco was a trade name assigned to a product line of automotive lacquer developed by the DuPont Company in the 1920s.
Similarly, Remington used Dupont Imron to finish guns in the 70/80's.