Skip to content

Conversation

typeid
Copy link
Contributor

@typeid typeid commented Jul 2, 2023

What's the purpose of this PR?

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

@ChuckCrawford ChuckCrawford self-requested a review September 22, 2023 13:13
@ChuckCrawford
Copy link
Collaborator

Makes good sense. Thank you for the contribution @typeid.

@ChuckCrawford ChuckCrawford merged commit 1f42b45 into PagerDuty:main Sep 22, 2023
gringus pushed a commit to gringus/go-pagerduty that referenced this pull request Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants