Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

qdqwdqw

package main

import "fmt"

type A interface {
    A()
}
type B interface {
    A
    B()
}

type AA struct {}
type BB struct {}

func (aa *AA) A() {
    fmt.Println("AA method A()")
}


func (bb *BB) A() {
    fmt.Println("BB method A()")
}


func (bb *BB) B() {
    fmt.Println("BB method B()")
}

func Factory(c *A) (d *A) {
    return d, nil
}

func main() {
    aa := &AA{}
    aa.A()
   fmt.Printf("hello, world\n")
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.