• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Function calling inner function that has a different signature

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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

E.g.



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
reply
    Bookmark Topic Watch Topic
  • New Topic