Skip to content

Conversation

@AHAAW
Copy link

@AHAAW AHAAW commented Dec 24, 2024

No description provided.

Comment on lines +7 to +21
type Product interface {
GetInfo()
GetPrice() float64
EditPrice(float64)
ApplyDiscount(float64)
EditDescription(string)
}

func CalculatePrice(list []Product) float64 {
var sum float64 = 0
for _, price := range list {
sum += price.GetPrice()
}
return sum
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В отдельный файл, разные сущности нужно всегда хранить отдельно

(*m).Sensor = NewDescription
}

func (m Mouse) GetInfo() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А здесь почему без указателя? Есть какое-то необходимость в этом? Это не указание на ошибку, именно вопрос

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants