protoc-gen-ent: support timestamp and date#591
protoc-gen-ent: support timestamp and date#591simon-wenmouth wants to merge 1 commit intoent:masterfrom
Conversation
Use of types `google.protobuf.Timestamp` and `google.type.Date` currently panics because they are MessageType but not edges. > panic: runtime error: invalid memory address or nil pointer dereference > [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xae904d] > > goroutine 1 [running]: > main.toEdge(0xc0003d1ba0) > ... entgo.io/contrib@v0.5.0/entproto/cmd/protoc-gen-ent/main.go:146 +0x8d The method `isEdge` was updated to recognize these types as fields, and the method `toField` was updated to map them as `field.Time`.
|
The tool I think this PR duplicates in part the work in #447 (March 2023), which has not received feedback. I welcome your feedback, and look forward to the possibility of the feature getting merged in the future. Thanks! |
Use of types
google.protobuf.Timestampandgoogle.type.Datecurrently panics because they are MessageType but not edges.The method
isEdgewas updated to recognize these types as fields, and the methodtoFieldwas updated to map them asfield.Time.