Skip to content

Instantly share code, notes, and snippets.

@uzimith
Last active August 29, 2015 14:13
Show Gist options
  • Save uzimith/8a17a45a375de4e960e4 to your computer and use it in GitHub Desktop.
Save uzimith/8a17a45a375de4e960e4 to your computer and use it in GitHub Desktop.
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