delete Greeter interface

make it canonic Go
This commit is contained in:
djmil 2026-05-05 00:28:51 +00:00
parent 390ffa19a4
commit 7748ebfd89
2 changed files with 1 additions and 7 deletions

View File

@ -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")

View File

@ -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