Should breastfeeding not hurt at all, even initially?

I was told that if breastfeeding hurts then I should break the latch and try again, but what if it only hurts initially? As soon as my baby latches it’s kind of a shocking pain but if I just leave him be it stops hurting very quickly. It doesn’t look to me like he is not latched properly but I could be wrong.