From 79b2d425cfdba54e5f4d75a698ad71655a7bb7c1 Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Sat, 11 May 2024 07:56:43 -0700 Subject: [PATCH] types/views: move AsMap to Map from *Map This was a typo in 2e19790f611cd15d603eac35bae46cb3c707ef85. It should have been on `Map` and not on `*Map` as otherwise it doesn't allow for chaining like `someView.SomeMap().AsMap()` and requires first assigning it to a variable. Updates #typo Signed-off-by: Maisem Ali --- types/views/views.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/views/views.go b/types/views/views.go index d58d49db6..387ff0fd9 100644 --- a/types/views/views.go +++ b/types/views/views.go @@ -387,8 +387,8 @@ func (m *Map[K, V]) UnmarshalJSON(b []byte) error { // AsMap returns a shallow-clone of the underlying map. // If V is a pointer type, it is the caller's responsibility to make sure // the values are immutable. -func (m *Map[K, V]) AsMap() map[K]V { - if m == nil { +func (m Map[K, V]) AsMap() map[K]V { + if m.ж == nil { return nil } return maps.Clone(m.ж)