diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-10 03:19:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-10 03:19:09 +0900 |
| commit | 109aaee6593ac6e72d23b817e5b75292c2ed7bed (patch) | |
| tree | 459fbd8f8c0685b33002fb1f9c101c9b39a38b6a /internal/app/finalise.go | |
| parent | 22ee5ae151fa991cf23dbf1b3efb5a0d6fb9b092 (diff) | |
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 <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/finalise.go')
| -rw-r--r-- | internal/app/finalise.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/app/finalise.go b/internal/app/finalise.go index 62b380e4..0adfcb4e 100644 --- a/internal/app/finalise.go +++ b/internal/app/finalise.go @@ -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 } |
