Skip to content

fix deprecated reflect.PtrTo reflect.PointerTo usage#7366

Merged
jinzhu merged 4 commits intogo-gorm:masterfrom
Aman-Shitta:fix/deprecated-reflect-pointer
Feb 13, 2025
Merged

fix deprecated reflect.PtrTo reflect.PointerTo usage#7366
jinzhu merged 4 commits intogo-gorm:masterfrom
Aman-Shitta:fix/deprecated-reflect-pointer

Conversation

@Aman-Shitta
Copy link
Copy Markdown
Contributor

  • Do only one thing
  • Non-breaking API changes
  • Tested

What did this pull request do?

Fixed deprecated usage of reflect.PtrTo and replaced it with reflect.PointerTo for slice creation.

User Case Description

This fix addresses a deprecation warning related to reflect.PtrTo, ensuring compatibility with the latest Go versions. The change prevents potential issues with reflect-based model handling and improves maintainability.

@Aman-Shitta
Copy link
Copy Markdown
Contributor Author

@daheige can you review ?

Copy link
Copy Markdown
Member

@a631807682 a631807682 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace all uses of PtrTo instead of just one

@Aman-Shitta
Copy link
Copy Markdown
Contributor Author

@a631807682 I have fixed all uses of PtrTo

Copy link
Copy Markdown
Contributor

@daheige daheige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@daheige
Copy link
Copy Markdown
Contributor

daheige commented Feb 11, 2025

@a631807682 I have fixed all uses of PtrTo

@jinzhu Please help to see if this mr needs to be merged.

@Aman-Shitta
Copy link
Copy Markdown
Contributor Author

@jinzhu Can you please check and verify the PR ?

@jinzhu jinzhu merged commit 9f27377 into go-gorm:master Feb 13, 2025
phroggyy pushed a commit to incident-io/gorm that referenced this pull request Jan 23, 2026
* fix deprecated reflect.PtrTo reflect.PointerTo usage

* replace all deprecated reflect.PtrTo reflect.PointerTo usage
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.

4 participants