This PR removes the strPtr helper function, as it is not necessary and was missleading.
Why?
The strPtr function was used to initialize a string and get its pointer in a single line. As this was only used for initializing empty strings and returning their pointer, it's equivalent to new(string). For unit tests, it makes sense to reference the same values for the created json and the unmarshalled output.
The strPtr function was missleading because it took a string by copy instead of reference, meaning that it would not return the pointer to the passed string, but to the copy.
What's the purpose of this PR?
strPtr
helper function, as it is not necessary and was missleading.Why?
strPtr
function was used to initialize a string and get its pointer in a single line. As this was only used for initializing empty strings and returning their pointer, it's equivalent tonew(string)
. For unit tests, it makes sense to reference the same values for the created json and the unmarshalled output.strPtr
function was missleading because it took a string by copy instead of reference, meaning that it would not return the pointer to the passed string, but to the copy.