Closed miekg closed 10 years ago
One plus for getters is that it works with interfaces where fields do not. I can think of a few examples where we may want to make Server and interface in the future and would have to revert the public fields.
I don't like having code or writing code for some future event. On the other hand, it is probably not worth cleaning up at this point. On the other other hand, I might see what the actual code reduction is, if is really big, I might be tempted to make this change.
Why are all the members of the Server struct private? We now need accessor function like DNSaddr() and HTTPaddr() which just return a private member.
Why not make member for which it makes sense public? Would reduce the code a bit.