• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Function calling inner function that has a different signature

Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a func with the following signature:

I have some business logic firing off internally, but it holds different return types and generally speaking a different signature


and then the ID that I succesfully retrieved is used here:

My understanding is that whatever logic I fired off inside a func that is part of an external function needs aligning with returned types. I ended up having something along these lines, but I truly dislike it:

func haveYouFoundTheID(request *SomeRequest) (uuid.UUID, error, repository.MyRepository, []event.Event, error, bool){
id, err := retrieveID(request.params) (uuid.UUID, error)

then  it is used in my outer func like this:

Is there a better way to do it? Thank you
bacon. tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic