FAQ
Here's a fun one from the wild:

type Uuid []byte
type UuidKey string

func (u Uuid) Key() string { return string(u) }

id := ...
m := make(map[UuidKey]struct{})
m[id.Key()] = struct{}{}

Is the compiler smart enough for this one?

Aside, we're thinking of changing Uuid to be a [16]byte or even
[2]uint64, but there are a few places where it was useful to have a
nil-able thing.

https://codereview.appspot.com/8090046/

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedApr 2, '13 at 5:48a
activeApr 2, '13 at 5:48a
posts1
users1
websitegolang.org

1 user in discussion

Fullung: 1 post

People

Translate

site design / logo © 2022 Grokbase