Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- So what I want to do is to give a configuration object to every controller
- and the controller can call only specific methods on it.
- */
- type SuperInterface interface {
- myfunc()
- }
- type SuperClass struct{}
- func (s SuperClass) myfunc() {
- }
- func (s SuperClass) myfunc2() {
- }
- func someCallable(s SuperInterface) {
- s.myfunc() // legal
- s.myfunc2() // illegal
- }
- func test() {
- a := SuperClass{}
- someCallable(a)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement