Not sure if it is a mating thing. Goldfish are very social, it could be just very happy to have a tank mate.
I have two male goldfish myself, so have not seen mating behavior myself.
Took this from another forum, maybe it will help.
Sexing goldfish (with photos)!
At about two years for males, and three years for females, goldfish begin to show signs that can help identify males and females. My darlings started to show and I was able to get a few good shots, so I thought I'd post them.
Males develop tubercles, white spots on gill covers, as Napoleon, a comet, shows here:
And as my little fancy shows here:
However, Upstart, a female, has compeletely smooth gill covers:
An excellent site with more photos can be found here: