mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-31 21:42:24 +00:00
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 <maisem@tailscale.com>
This commit is contained in:
parent
fc1ae97e10
commit
79b2d425cf
@ -387,8 +387,8 @@ func (m *Map[K, V]) UnmarshalJSON(b []byte) error {
|
|||||||
// AsMap returns a shallow-clone of the underlying map.
|
// AsMap returns a shallow-clone of the underlying map.
|
||||||
// If V is a pointer type, it is the caller's responsibility to make sure
|
// If V is a pointer type, it is the caller's responsibility to make sure
|
||||||
// the values are immutable.
|
// the values are immutable.
|
||||||
func (m *Map[K, V]) AsMap() map[K]V {
|
func (m Map[K, V]) AsMap() map[K]V {
|
||||||
if m == nil {
|
if m.ж == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return maps.Clone(m.ж)
|
return maps.Clone(m.ж)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user