From 109aaee6593ac6e72d23b817e5b75292c2ed7bed Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 10 Oct 2025 03:19:09 +0900 Subject: internal/app: copy parts of config to state This is less error-prone than passing the address to the entire hst.Config struct, and reduces the likelihood of accidentally clobbering hst.Config. This also improves ease of testing. Signed-off-by: Ophestra --- internal/app/app_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/app/app_test.go') diff --git a/internal/app/app_test.go b/internal/app/app_test.go index 34313df1..96b36707 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -464,7 +464,7 @@ func TestApp(t *testing.T) { } gotSys = system.New(t.Context(), msg, sPriv.uid.unwrap()) - if err := (&outcomeStateSys{config: tc.config, sys: gotSys, outcomeState: &sPriv}).toSystem(); err != nil { + if err := sPriv.newSys(tc.config, gotSys).toSystem(); err != nil { t.Fatalf("toSystem: error = %#v", err) } -- cgit v1.3.1