Is there a way to make an interface also include the methods defined by another interface in Go?
For example:
type BasicDatabase interface {
CreateTable(string) error
DeleteTable(string) error
}
type SpecificDatabase interface {
CreateUserRecord(User) error
}
I would like a way to specify that the SpecificDatabase
interface contains the BasicDatabase
interface. Similar to the way Go lets you do composition of structs.
This way my methods can take a type that implements SpecificDatabase
but still call CreateTable()
on it.