1. Задача: Выполнить рефакторинг предложенного кода
package main
import (
"errors"
"math"
)
type Parrot interface {
Speed() (float64, error)
}
type europeanParrot struct{}
func NewEuropeanParrot() Parrot {
return &europeanParrot{}
}
func (p *europeanParrot) Speed() (float64, error) {
return p.baseSpeed(), nil
}
func (p *europeanParrot) baseSpeed() float64 {
return 12.0
}
type africanParrot struct {
numberOfCoconuts int
}
func…