delete Greeter interface
make it canonic Go
This commit is contained in:
parent
390ffa19a4
commit
7748ebfd89
@ -42,7 +42,7 @@ func showGreeting() {
|
|||||||
}).Info("starting up")
|
}).Info("starting up")
|
||||||
|
|
||||||
// ── Services ──────────────────────────────────────────────────────────────
|
// ── Services ──────────────────────────────────────────────────────────────
|
||||||
var greetSvc greeter.Greeter = greeter.New(log)
|
greetSvc := greeter.New(log)
|
||||||
|
|
||||||
// ── Example usage ─────────────────────────────────────────────────────────
|
// ── Example usage ─────────────────────────────────────────────────────────
|
||||||
msg := greetSvc.Greet(cfg.Greeter.Name).Expect("greeting")
|
msg := greetSvc.Greet(cfg.Greeter.Name).Expect("greeting")
|
||||||
|
|||||||
@ -14,12 +14,6 @@ import (
|
|||||||
"gitea.djmil.dev/go/template/pkg/result"
|
"gitea.djmil.dev/go/template/pkg/result"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Greeter produces a greeting for a given name.
|
|
||||||
// The interface is what other packages should depend on — never the concrete type.
|
|
||||||
type Greeter interface {
|
|
||||||
Greet(name string) result.Expect[string]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Service is the concrete implementation.
|
// Service is the concrete implementation.
|
||||||
type Service struct {
|
type Service struct {
|
||||||
log *logger.Logger
|
log *logger.Logger
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user