This is a fun tutorial for processing audio in Go, but generally panning will sound bad if you only adjust the amplitude/level. The two important missing pieces are phase delay and frequency-specific attenuation (the "head" model). Audio coming from the left side of your head reaches your left ear first, then your right ear later. Also, your head blocks certain frequencies more than others. Both of these effects are…
You say this like it's bog standard but adding HRTF and compensation for speaker distance are not part of a standard panning algorithm. This is more likely to exist in another module, such as for ambisonics or correction.
I agree that HRTFs are uncommon in mixing, but spatialization without some frequency dependent attenuation generally sounds "flat" with headphones.
Although VR systems and big budget spatialization like Atmos will account for speaker distance (so called near field effects) it's almost impossible to notice those effects for stationary sources and no head-tracking.