Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab7 #605

Open
wants to merge 1 commit into
base: Golovin_Daniil
Choose a base branch
from
Open

Lab7 #605

wants to merge 1 commit into from

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