diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d5c0e43..25815f76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ @samber: I sometimes forget to update this file. Ping me on [Twitter](https://twitter.com/samuelberthe) or open an issue in case of error. We need to keep a clear changelog for easier lib upgrade. -## 1.38.0 (2023-xx-xx) +## 1.38.1 (2023-03-20) Improvement: - Async and AsyncX: now returns `<-chan T` instead of `chan T` diff --git a/type_manipulation.go b/type_manipulation.go index c392df37..45d8fe20 100644 --- a/type_manipulation.go +++ b/type_manipulation.go @@ -10,6 +10,7 @@ func ToPtr[T any](x T) *T { // EmptyableToPtr returns a pointer copy of value if it's nonzero. // Otherwise, returns nil pointer. func EmptyableToPtr[T any](x T) *T { + // 🤮 isZero := reflect.ValueOf(&x).Elem().IsZero() if isZero { return nil