stretchr / objx

Go package for dealing with maps, slices, JSON and other data.
MIT License
695 stars 75 forks source link

Consider making `Value` just a type of `interface{}` #6

Closed matryer closed 10 years ago

tylerstillwater commented 10 years ago

We can't do this as you cannot define methods on an interface{}

matryer commented 10 years ago

I mean like this:

type Value interface{}

We can then define methods on Value.

tylerstillwater commented 10 years ago

You can't do that. That's what I was saying in my close comment.

Sent from my iPhone

On Sep 22, 2013, at 10:16 AM, Mat Ryer notifications@github.com wrote:

I mean like this:

type Value interface{} We can then define methods on Value.

— Reply to this email directly or view it on GitHub.

matryer commented 10 years ago

Really?

type Value interface{}
func (v Value) Something() { ... }

That doesn't work?

matryer commented 10 years ago

... you're right

http://play.golang.org/p/U_xd6iENbE