Re: [go-nuts] map without default values

2020-08-14 Thread Joe Marty
> > > If I know that a value exists, or am fine using the zero value (again, > that's the majority of my personal use-cases for maps at least), having to > use a statement just to discard the extra bool is annoying. > Right, so this brings me back to a nice solution to both our use cases, wh

Re: [go-nuts] map without default values

2020-08-14 Thread Joe Marty
hat panicking on a non-existent key is better - >> either in general, or in the majority of cases. Personally, I don't think I >> encountered many use-cases where the zero-value wasn't the perfect thing to >> use. I'm not saying your use-case doesn't exist

[go-nuts] map without default values

2020-08-13 Thread Joe Marty
I'm very new to Go - apologies in advance if I'm missing something: I find it frustrating that there's no way to create a map that does *not* automatically return a zero value for undefined key access by default. I love the fact that Go doesn't return "nil" for this use case (I love Ruby, but I