Last active
August 29, 2015 14:13
-
-
Save uzimith/8a17a45a375de4e960e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Controller struct{} | |
type User struct { | |
*Controller | |
} | |
func test(c *Controller) { | |
fmt.Printf("%+v", c) | |
} | |
func main() { | |
c := Controller{} | |
test(&c) | |
u := User{} | |
c_u, _ := interface{}(u).(Controller) | |
test(&c_u) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment