On Sun, Jun 28, 2020 at 1:45 PM Diego Augusto Molina
<diegoaugustomol...@gmail.com> wrote:
>
> Hi, I think I spotted a small typo in the draft. In Examples >
> Containers we have:
> <code>
> // Find returns the value associated with a key, or zero if not present.
> // The bool result reports whether the key was found.
> func (m *Map(K, V)) Find(k K) (V, bool) {
>         pn := m.find(k)
>         if *pn == nil {
>                 var zero val // see the discussion of zero values, above
>                 return zero, false
>         }
>         return (*pn).v, true
> }
> </code>
>
> Whereas I think it should be:
> <code>
> // Find returns the value associated with a key, or zero if not present.
> // The bool result reports whether the key was found.
> func (m *Map(K, V)) Find(k K) (V, bool) {
>         pn := m.find(k)
>         if *pn == nil {
>                 var zero V // see the discussion of zero values, above
>                 return zero, false
>         }
>         return (*pn).v, true
> }
> </code>
>
> Patch attached.

Thanks, sent https://golang.org/cl/240340.

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/CAOyqgcXkdSCY3L3784bttbNTgAxz4Ap_OzV41kbPQ7Jd4bqsZA%40mail.gmail.com.

Reply via email to