Initial split of internal and external api types.

OK, I see it doesn't work, but I don't understand WHY.  I can take the
address of a local.  why can't I do that through reflection?


On Tue, Jul 15, 2014 at 10:04 PM, Daniel Smith <notifications@github.com>
wrote:

> In pkg/api/internal/helper.go:
>
> > +	obj = checkPtr(obj)
> > +	jsonBase, err := prepareEncode(obj)
> > +	if err != nil {
> > +		return nil, err
> > +	}
> > +	data, err = json.MarshalIndent(obj, "", "	")
> > +	jsonBase.Kind = ""
> > +	return data, err
> > +}
> > +
> > +func checkPtr(obj interface{}) interface{} {
> > +	v := reflect.ValueOf(obj)
> > +	if v.Kind() == reflect.Ptr {
> > +		return obj
> > +	}
> > +	v2 := reflect.New(v.Type())
>
> http://play.golang.org/p/8N7pqWMQrx
>
> --
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/476/files#r14981435>
> .
>