Package xpe contains an experimental Go module for determining the number of performance and efficiency cores ("P-Cores" and "E-Cores") on the runtime CPU architecture.
CAVEATS: Currently only useful on Darwin (macOS) and associated Apple Silicon hardware. Should be possible to add Linux functionality and support for the 12th Gen ("Alder Lake") and beyond Intel processors, but I don't have the hardware to test this. Collaborators desired!