Project

General

Profile

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.

Status:
Closed
Priority:
Normal
Start date:
Due date:
12/04/2024
% Done:

100%

Estimated time:

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.

#1

Updated by Shuvam Misra about 1 year ago

  • Target version changed from Sprint 29 Mar to Sprint 12 Apr
#2

Updated by Sachin Divekar about 1 year ago

  • Status changed from New to In Progress
#3

Updated by Sachin Divekar about 1 year ago

  • % 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.

#4

Updated by Sachin Divekar about 1 year ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Testing
#5

Updated by Sachin Divekar about 1 year ago

  • Status changed from Testing to Closed

Also available in: Atom PDF