Pass common object to nested structs

Thanks for the suggestion. I have two comments:

  1. I don’t like having having a logger Logger argument in the default creation function as in most cases the default will just work fine. Thus, I’d force regular users to always pass nil, making the call more complicated. That might be not too bad right now, but I’d rather not end up with something like NewFoo(3, nil, nil, nil).
  2. NewBar not constructing Foo seems reasonable. My intention was to hide the complexity for regular users. In most cases they don’t need to know and also don’t need to care that there even is the Foo object. Thus, adding it to NewBar makes it more complicated for them without good reason. I’ll have to think about this a little more.