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.

-- 
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/CAGOxLdF76jLN0WCtPHP7FL1chVTJ5WJkf9%2BAmhVPgsyhh4W9OA%40mail.gmail.com.

Attachment: fix-typo.patch
Description: Binary data

Reply via email to