>
> Yes, I guess I was seeing it as more of a grey thing, possibly from to much
> c code in my life...
> Just as I didn't define *Bleh only Bleh I assumed []Bleh would function in a
> similar fashion.
> But I guess * is a type attribute not a type itself so...
Go slice's are slices, not pointers to a sequence of things stored
side-by-side. :)
C-> []int == *int
Go-> []int != *int
That's why *Bleh works, and []Bleh don't.
In the first case, you are declaring a method with a receiver that is
a pointer-to your owned type.
In the second, you are declaring a method with a receiver that is a
slice of your owned type. And, like Jeremy already explained, slices
are types that you don't own, so you can't define types on those.
When you write
type Blehs []Bleh
func (b Blehs) Method1() { ... }
func (b Blehs) Method2() { ... }
Your are telling to the compiler:
I own a type that is based on a slice of Bleh and have this extra methods.