McGoldrick marks summer return with winner with Maitland-Niles and Pitman also on target
The frontman, who missed the trips to Ireland and Germany after returning to pre-season training two weeks later than the rest of the squad following his international commitments with the Republic of Ireland, edged Blues in front just past the hour.
Ainsley Maitland-Niles had given Town an early lead with Brett Pitman adding a second - his fourth goal in Blues’ pre-season - before Cambridge levelled with goals either side of half-time through Barry Corr and Luke Berry.
Town got off to the perfect start in the sunshine at the Abbey Stadium with Maitland-Niles finding the net on three minutes with a left foot finish after Freddie Sears had fed the ball into the box.
Pitman almost made it two soon after, the June arrival from Bournemouth escaping his marker to get on the end of Kevin Bru’s pass but his lob drifted over the bar.
Robbie Simpson volleyed wide for the home side, Pitman then linking up well with Sears before firing over from the edge of the box.
Sears saw his effort blocked after a mazy run, Simpson sending a left foot strike past Bart Bialkowski’s right hand post at the other end.
Town extended the lead just before the half hour, Maitland-Niles cut inside and his shot took a heavy deflection before bouncing back off the bar, Pitman reacting quickest to the loose ball to find the corner of the net.
Cambridge reduced the arrears seven minutes before the break when Corr was left alone to head in from Jeff Hughes’ corner, with Blues forced to make an early change as the second-half got underway, Pitman limping off to be replaced by McGoldrick.
Maitland-Niles and Luke Chambers linked up well down the right as Blues threatened a third but it was Cambridge who struck next, Berry scoring superbly from a free-kick on 55 minutes.
McGoldrick soon had Town back in front just past the hour though, Maitland-Niles sending him through on goal and the Republic of Ireland international making no mistake from the angle.
McGoldrick was denied a second, with Kyle Hammond and Teddy Bishop also going close late on.