Re: [go-nuts] Are functional options idiomatic

2017-07-09 Thread Sam Whited
On Sun, Jul 9, 2017 at 2:05 PM, 'Anmol Sethi' via golang-nuts wrote: > I haven’t seen this API design used anywhere at all in any library I have > ever used (or in the standard library at all) so I was wondering whether or > not it’s idiomatic. It's used heavily in the golang.org/x/text subrepos,

[go-nuts] Are functional options idiomatic

2017-07-09 Thread 'Anmol Sethi' via golang-nuts
Hello everyone! I’m writing a new library where I need to be able to configure a struct. This struct and its configuration will be accessed concurrently. One design pattern I see throughout the standard library and community is to make the struct and its configuration fields public but all othe