Approach number one is the correct way, IMO. That's what I've always done: https://godoc.org/github.com/mdlayher/netlink#Conn.Execute.
- Matt On Tuesday, June 6, 2017 at 3:56:43 PM UTC-4, M2 wrote: > > I need to expose 2 ways of doing the same thing. > > - The first way is very simple, always does the right thing and is > impossible to use improperly. It is expected to be used by the majority of > users. > - The second one can be used improperly but offers more flexibility. It is > expected to be used by a minority of users. > > What is the idiomatic way in go to expose them? > 1). Have them both in the same package since they do the same thing and > just document them properly. > 2). Have them in different packages with one named .../unsafe/myPackage/ > and one named .../safe/myPackage/ then have a third package that has all > the private stuff that will be accessed by both unsafe and safe package > > Thanks > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.