You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The New constructor feels misleading from the initial reading, assuming that the options would be consumed as a whole, and not ignored. In many go examples, a variadic argument should be consumed by default.
func New(options ...Options) (*Sqids, error)
What I'd suggest is a break, but a worthwhile one, where the Options type becomes a function operating on an Option that sequentially get applied (and remains true with the default setting), so that consumers can do something like in this playground (copying here for persistence)
The
New
constructor feels misleading from the initial reading, assuming that the options would be consumed as a whole, and not ignored. In many go examples, a variadic argument should be consumed by default.What I'd suggest is a break, but a worthwhile one, where the
Options
type becomes a function operating on an Option that sequentially get applied (and remains true with the default setting), so that consumers can do something like in this playground (copying here for persistence)The text was updated successfully, but these errors were encountered: