How do I make the below code works? I want to call the Age method with Gents type.
package main
type Man struct {
}
func (man *Man) Age() {
}
type Gents Man
func main() {
var m1 Man
m1.Age()
var g1 Gents
g1.Age()
}
How do I make the below code works? I want to call the Age method with Gents type.
package main
type Man struct {
}
func (man *Man) Age() {
}
type Gents Man
func main() {
var m1 Man
m1.Age()
var g1 Gents
g1.Age()
}
Basically, you want to do inheritance
go playground link