From 01fc0fdb4c6a151e4cd31a4e991b0181f1409d85 Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Tue, 21 Mar 2023 04:40:24 +0100 Subject: [PATCH] bump v1.38.1 --- CHANGELOG.md | 2 +- type_manipulation.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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