3 ms·
I'm new to this syntax too, but I believe it's just a reference to the function `SayHello` as defined on the `Context*` type. That is, if you have: func F
by ghayes 13y ago
I'm new to this syntax too, but I believe it's just a reference to the function `SayHello` as defined on the `Context*` type. That is, if you have:
func FuncA() { } // normal function
func (int) FuncB() { } // function on an int object
You could later reference those functions via:
var func1 := FuncA // assign FuncA into func1 var
var func2 := (int).FuncB // assign FuncB into func2 var
But again, I'm just piecing that together from context and haven't looked at the spec.
- recuter 13y agoSo you're (ab?)using this to peg middleware functions on the context object? Why do it like that?
- nemothekid 13y agoI was missing that piece, but how is func2 called? I'm still looking through the code, but if both func2 and a int_variable are interface{}, how does the compiler check these types (or is the "framework" using some reflection?)