- Add ADR-0012 documenting the decision to format only staged Go files - Update ADR README.md with new entry - Document rationale, alternatives, and verification results - Include future considerations for monitoring and CI/CD integration Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
25 lines
492 B
Go
25 lines
492 B
Go
package greet
|
|
|
|
import (
|
|
"context"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
type Service struct{}
|
|
|
|
func NewService() *Service {
|
|
return &Service{}
|
|
}
|
|
|
|
// Greet returns a greeting message for the given name.
|
|
// If name is empty, it defaults to "world".
|
|
// Implements the Greeter interface.
|
|
func (s *Service) Greet(ctx context.Context, name string) string {
|
|
log.Trace().Ctx(ctx).Str("name", name).Msg("Greet function called")
|
|
|
|
if name == "" {
|
|
return "Hello world!"
|
|
}
|
|
return "Hello " + name + "!"
|
|
}
|