Use type switch in merge functions

Followup PR from #262. 

* Use a type switch rather than a type assertion when checking for unexpected values in merge functions
* Drive by code cleanups.
Fixed


On Tue, Jul 8, 2014 at 12:21 PM, Tim Penhey <notifications@github.com>
wrote:

> In state/watcher.go:
>
> >  			if exists {
> >  				changes.Add(id)
> >  			} else {
> >  				changes.Remove(id)
> >  			}
> > -		} else {
> > -			return fmt.Errorf("id is not of type string")
> > +		default:
> > +			return errors.Errorf("id is not of type string, go %T", id)
>
> s/go/got/ ?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/juju/juju/pull/263/files#r14634056>.
>