internal/app: copy parts of config to state
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m12s
Test / Hakurei (push) Successful in 3m7s
Test / Hpkg (push) Successful in 4m4s
Test / Sandbox (race detector) (push) Successful in 4m30s
Test / Hakurei (race detector) (push) Successful in 5m20s
Test / Flake checks (push) Successful in 1m34s

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 <cat@gensokyo.uk>
This commit is contained in:
2025-10-10 03:19:09 +09:00
parent 22ee5ae151
commit 109aaee659
8 changed files with 45 additions and 25 deletions

View File

@@ -81,7 +81,7 @@ func (k *outcome) finalise(ctx context.Context, msg message.Msg, id *state.ID, c
}
sys := system.New(k.ctx, msg, s.uid.unwrap())
if err := (&outcomeStateSys{config: config, sys: sys, outcomeState: &s}).toSystem(); err != nil {
if err := s.newSys(config, sys).toSystem(); err != nil {
return err
}