Skip to content

Commit 9676054

Browse files
committed
shouldn't require user gob registration
1 parent 800c0ed commit 9676054

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

dbos/serialization_test.go

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -591,57 +591,6 @@ func serializerRecoveryWorkflow(ctx DBOSContext, input TestWorkflowData) (TestWo
591591
}, WithStepName("BlockingStep"))
592592
}
593593

594-
// init registers all custom types with gob for gobSerializer
595-
// Note: gob requires concrete types to be registered. Interface types cannot be registered
596-
// directly - only their concrete implementations. When encoding interface{} fields,
597-
// gob needs the concrete type to be registered.
598-
func init() {
599-
// Register wrapper type
600-
safeGobRegister(gobValue{})
601-
602-
// Register test data types (concrete structs)
603-
safeGobRegister(TestData{})
604-
safeGobRegister(NestedTestData{})
605-
safeGobRegister(TestWorkflowData{})
606-
607-
// Register custom type aliases (must register with concrete value)
608-
safeGobRegister(MyInt(0))
609-
safeGobRegister(MyString(""))
610-
safeGobRegister(TwiceInt(0))
611-
612-
// Register struct with interface fields (the struct itself is concrete)
613-
safeGobRegister(WithInterfaces{})
614-
615-
// Register slices of custom types
616-
safeGobRegister([]MyString(nil))
617-
safeGobRegister([]MyInt(nil))
618-
safeGobRegister([]int(nil))
619-
safeGobRegister([]string(nil))
620-
safeGobRegister([]bool(nil))
621-
safeGobRegister([]NestedTestData(nil))
622-
623-
// Register maps with custom types
624-
safeGobRegister(map[string]MyInt(nil))
625-
safeGobRegister(map[string]string(nil))
626-
safeGobRegister(map[string]int(nil))
627-
safeGobRegister(map[string]bool(nil))
628-
safeGobRegister(map[string]any(nil))
629-
safeGobRegister(map[NestedTestData]MyInt(nil))
630-
631-
// Register pointer types
632-
safeGobRegister((*int)(nil))
633-
safeGobRegister((*string)(nil))
634-
safeGobRegister((*bool)(nil))
635-
safeGobRegister((*TestWorkflowData)(nil))
636-
safeGobRegister((*TestData)(nil))
637-
safeGobRegister((*NestedTestData)(nil))
638-
safeGobRegister((*MyInt)(nil))
639-
safeGobRegister((*MyString)(nil))
640-
641-
// Register time.Time (used in workflow timeouts and sleep operations)
642-
safeGobRegister(time.Time{})
643-
}
644-
645594
// Test that workflows use the configured serializer for input/output
646595
func TestSerializer(t *testing.T) {
647596
t.Run("Gob", func(t *testing.T) {

0 commit comments

Comments
 (0)