13 lines
533 B
Markdown
13 lines
533 B
Markdown
# 05 — Interfejsy i Kompozycja („OOP po Go-owemu”)
|
|
|
|
W Go **nie ma dziedziczenia klas** — jest **embedding** (kompozycja struktur) oraz **niejawne interfejsy** (typ spełnia interfejs automatycznie, jeśli ma wymagane metody).
|
|
|
|
## Zadania (`interfaces.go`)
|
|
1. `EmailNotifier` i `SmsNotifier` spełniające interfejs `Notifier`.
|
|
2. `AlertService.Broadcast(msg string) []string` — wywołuje `Format(msg)` dla każdego notifiera.
|
|
|
|
## Uruchomienie testów
|
|
```bash
|
|
make test PKG=./exercises/01-core/05-interfaces-composition
|
|
```
|