collection

package
v0.0.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeMap

type SafeMap struct {
	// contains filtered or unexported fields
}

SafeMap provides a map alternative to avoid memory leak. This implementation is not needed until issue below fixed. https://github.com/golang/go/issues/20135

func NewSafeMap

func NewSafeMap() *SafeMap

NewSafeMap returns a SafeMap.

func (*SafeMap) Del

func (m *SafeMap) Del(key interface{})

Del deletes the value with the given key from m.

func (*SafeMap) Get

func (m *SafeMap) Get(key interface{}) (interface{}, bool)

Get gets the value with the given key from m.

func (*SafeMap) Set

func (m *SafeMap) Set(key, value interface{})

Set sets the value into m with the given key.

func (*SafeMap) Size

func (m *SafeMap) Size() int

Size returns the size of m.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL