package icoder-new
import "fmt"
type Programmer interface {
Eat()
Code()
Sleep()
}
type Gopher struct {
name string
}
func NewGopher(name string) *Gopher {
return &Gopher{name: name}
}
func (g *Gopher) Eat() {
fmt.Printf("%s is eating...\n", g.name)
}
func (g *Gopher) Code() {
fmt.Printf("%s is coding...\n", g.name)
}
func (g *Gopher) Sleep() {
fmt.Printf("%s is sleeping...\n", g.name)
}
func Run() {
gopher := NewGopher("Ehson")
var programmer Programmer = gopher
programmer.Eat()
programmer.Code()
programmer.Sleep()
}
icoder-new Goto Github PK
Name: Ehson
Type: User
Company: @stellify-org
Bio: Young gopher from Dushanbe. "In search of incredible 🌟"
Location: Tajikistan, Dushanbe