If you need your RedirectUrl to be more dynamic, you could just instead do
redirectUrl := "http://localhost:9090/oauth2callback" token, err := oauthConf.Exchange(oauth2.NoContext, code, oauth2.SetAuthURLParam("redirect_uri", redirectURL))