Skip to content

Refactor to use Go standard library functions#663

Merged
fxamacker merged 2 commits intomasterfrom
fxamacker/refactor-to-use-reflect-funcs
May 19, 2025
Merged

Refactor to use Go standard library functions#663
fxamacker merged 2 commits intomasterfrom
fxamacker/refactor-to-use-reflect-funcs

Conversation

@fxamacker
Copy link
Owner

This PR replaces custom code with reflect functions added in Go 1.17 and Go 1.20.

  • Replace code with reflect package StructField.IsExported()
  • Replace code with reflect package Value.SetZero()

fxamacker added 2 commits May 18, 2025 13:53
This commit replaces custom code checking of StructField.PkgPath with
calling StructField.IsExported() added in Go 1.17.
This commit replaces custom code that resets zero value for
reflect.Value with reflect pkg Value.SetZero() added in Go 1.20.
@fxamacker fxamacker self-assigned this May 18, 2025
@fxamacker fxamacker added the improvement improvement that does not add new feature label May 18, 2025
@fxamacker
Copy link
Owner Author

@x448 PTAL 🙏

@fxamacker fxamacker merged commit 6d62627 into master May 19, 2025
22 checks passed
@fxamacker fxamacker added this to the v2.9.0 milestone Jul 5, 2025
@fxamacker fxamacker changed the title Refactor to use reflect package functions Refactor to use Go standard library functions Jul 14, 2025
@fxamacker fxamacker deleted the fxamacker/refactor-to-use-reflect-funcs branch September 16, 2025 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement improvement that does not add new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants