Ok, misunderstood that little bit. Basically it should return an empty map
rather than nil even if peers, requires, and provides are not mentioned in
the charm file. That will require a change in a different location,
meaning we may not need to change the map behavior at all.
On Tue, May 20, 2014 at 12:48 AM, William Reade <<email address hidden>
> wrote:
Ok, misunderstood that little bit. Basically it should return an empty map
rather than nil even if peers, requires, and provides are not mentioned in
the charm file. That will require a change in a different location,
meaning we may not need to change the map behavior at all.
On Tue, May 20, 2014 at 12:48 AM, William Reade <<email address hidden>
> wrote:
> LGTM, I'd accept this as-is, but please take a little look at the /codereview. appspot. com/98410043/ diff/1/ charm/meta_ test.go /codereview. appspot. com/98410043/ diff/1/ charm/meta_ test.go# oldcode163 test.go: 163: c.Assert( meta.Peers, gc.IsNil) /codereview. appspot. com/98410043/ diff/1/ schema/ schema. go /codereview. appspot. com/98410043/ diff/1/ schema/ schema. go#newcode297 schema. go:297: // handles case where map is empty /codereview. appspot. com/98410043/ /code.launchpad .net/~jimmiebtl r/juju- core/fix- no-peers- charm/+ merge/218195
> nil/map{} issue. If it's too complex, let me know, and I'll approve it.
>
> Dave, thanks for the caution; but schema isn't as heavily used as one
> might think (especially the map bits), and I think this is a good
> change.
>
>
> https:/
> File charm/meta_test.go (left):
>
>
> https:/
> charm/meta_
> It's this bit that bugs me, that I alluded to yesterday -- having a Meta
> type that sometimes has nil and sometimes has {} feels weirdly
> inconsistent. It's not really a very big deal, but I'd appreciate a fix
> if it's not excessively complex to change.
>
> https:/
> File schema/schema.go (right):
>
> https:/
> schema/
> treat nil value as empty map :)
>
> https:/
>
> --
>
> https:/
> You are the owner of lp:~jimmiebtlr/juju-core/fix-no-peers-charm.
>
--
Thanks,
Jimmie Butler