forked from security/hakurei
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>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user