Export InfoType for BaseThreadState to make it modifiable in libraries

graph-rework-2
noah metz 2023-06-26 17:03:09 -06:00
parent dc7f742f32
commit 4c462a1ec5
1 changed files with 4 additions and 4 deletions

@ -62,7 +62,7 @@ type BaseThreadState struct {
parent Thread
children []Thread
child_info map[NodeID] ThreadInfo
info_type reflect.Type
InfoType reflect.Type
}
type BaseThreadStateJSON struct {
@ -116,11 +116,11 @@ func (state * BaseThreadState) AddChild(child Thread, info ThreadInfo) error {
return fmt.Errorf("Will not connect the same child twice")
}
if info == nil && state.info_type != nil {
if info == nil && state.InfoType != nil {
return fmt.Errorf("nil info passed when expecting info")
} else if info != nil {
if reflect.TypeOf(info) != state.info_type {
return fmt.Errorf("info type mismatch, expecting %+v", state.info_type)
if reflect.TypeOf(info) != state.InfoType {
return fmt.Errorf("info type mismatch, expecting %+v", state.InfoType)
}
}