On Tue, Mar 21, 2017 at 1:26 PM, tamal <[email protected]> wrote: > > I keep finding myself writing the following method often when working with > GO code. I wonder if this can be added to `strings` pkg. > > func get(s, init string) string { > if s == "" { > return init > } > return s > }
The only advantage of putting it in the strings package is that everybody has access to it. The disadvantage is that there is more to know about the standard library. I don't personally think this meets the bar: I don't think enough people will use it. https://golang.org/doc/faq#x_in_std Ian -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
