Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- )
- type A struct {
- }
- type B struct {
- A
- }
- func (a* A) fun1() {
- fmt.Println("I'm in A.fun1()")
- a.fun2()
- }
- func (a* A) fun2() {
- fmt.Println("I'm in A.fun2()")
- }
- func (b* B) fun2() {
- fmt.Println("I'm in B.fun2()")
- }
- func main() {
- b := B{}
- b.fun1()
- }
- I'm in A.fun1()
- I'm in A.fun2()
- I'm in A.fun1()
- I'm in B.fun2()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement