From 7bc7ee47462193e58a2a1833ff6bfa472fa2d82c Mon Sep 17 00:00:00 2001 From: Micheal Wilkinson Date: Sat, 21 Mar 2026 11:18:45 +0000 Subject: [PATCH] chore(go): validate core constructor dependencies --- internal/homesick/core/core.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/homesick/core/core.go b/internal/homesick/core/core.go index f3c3f36..6668437 100644 --- a/internal/homesick/core/core.go +++ b/internal/homesick/core/core.go @@ -28,6 +28,13 @@ type App struct { } func New(stdout io.Writer, stderr io.Writer) (*App, error) { + if stdout == nil { + return nil, errors.New("stdout writer cannot be nil") + } + if stderr == nil { + return nil, errors.New("stderr writer cannot be nil") + } + home, err := os.UserHomeDir() if err != nil { return nil, fmt.Errorf("resolve home directory: %w", err)