Extracted JSON client functions into seperate package

Solves #317 
If it passes gofmt, sure. I don't think we use that style anywhere though.
Basically, gofmt is the source of truth for coding style in Golang, so we
don't have to argue about conventions
On 27 Oct 2014 16:02, "Corey Powell" <notifications@github.com> wrote:

> In controller/client/client.go:
>
> >  	if u.Scheme == "discoverd+http" {
> > -		if err := discoverd.Connect(""); err != nil {
> > -			return nil, err
> > -		}
> > -		dialer := dialer.New(discoverd.DefaultClient, nil)
> > -		c.dial = dialer.Dial
> > -		c.dialClose = dialer
> > -		c.http = &http.Client{Transport: &http.Transport{Dial: c.dial}}
> > -		u.Scheme = "http"
> > -		c.url = u.String()
> > +		return newDiscoverdClient(u, key)
> > +	} else {
> > +		return newClient(u.Host, key, u.String(), http.DefaultClient)
>
> Can I leave off the { } on the single line if, like in C? (or does that go
> against the Go style)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/flynn/flynn/pull/359/files#r19410175>.
>