On Thu, Oct 22, 2020 at 1:19 PM Andrew <angang....@gmail.com> wrote: > > I've finished the survey but want to add this: > Go can add something for library author to "differentiate if a value was set > or not internally", so that we can use plain Go type in the library. > > Here is a link to the problem: > https://github.com/mxschmitt/playwright-go/issues/49
Go does have a way: use a pointer, as that code is doing. Or you could use a separate field to record whether the value is set. Or you declare a type that uses two bools, and use that. And no doubt there are other ways to do it. So there are several possible approaches. I'm guessing you want one that is more implicit, but as a general guideline Go tends to prefer explicit code. 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUWbndTC%3DQtUgDHRGYWya2F2nB-wCA61LOTgO_sC9EAxg%40mail.gmail.com.