It seems that you have got infection in spermatic cord
or in testicles.
Have you got any history of some injury to testicles or groin ?
You might have small hydrocele
or some time indirect hernia
going to spermatic cord.
So you have to approach to surgeon as soon as possible.
If pain is more you can take analgesic
while going to surgeon.
ok and bye.