Task #18072
Go lib: change the ChangeDetail data structure to use strings
Added by Shuvam Misra about 1 year ago.
Updated about 1 year ago.
Description
Currently the ChangeDetail
data structure is
type ChangeDetail struct {
Field string `json:"field"`
OldVal any `json:"old_value"`
NewVal any `json:"new_value"`
}
The OldVal
and NewVal
fields need to be changed to strings.
- Target version changed from Sprint 29 Mar to Sprint 12 Apr
- Status changed from New to In Progress
- % Done changed from 0 to 90
- Due date changed from 29/03/2024 to 12/04/2024
Instead of changing the struct I have modified the function that creates change logentry to convert the values to their JSON string representation.
I have added a new private utility function func convertToString(value any) string
. This function is used internally when creating or adding changes.
Error handling in convertToString
has been designed to write errors directly to os.Stderr
. This simplifies the functional API for what is expected to be a rare event, allowing the calling code to proceed while still logging the conversion error.
- % Done changed from 90 to 100
- Status changed from In Progress to Testing
- Status changed from Testing to Closed
Also available in: Atom
PDF