maps
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package maps implements Go's builtin map type.
Package maps implements Go's builtin map type.
Package maps implements Go's builtin map type.
Index¶
- func OldMapKeyError(t *abi.OldMapType, p unsafe.Pointer) error
- type Iter
- type Map
- func (m *Map) Clear(typ *abi.SwissMapType)
- func (m *Map) Clone(typ *abi.SwissMapType) *Map
- func (m *Map) Delete(typ *abi.SwissMapType, key unsafe.Pointer)
- func (m *Map) Get(typ *abi.SwissMapType, key unsafe.Pointer) (unsafe.Pointer, bool)
- func (m *Map) Put(typ *abi.SwissMapType, key, elem unsafe.Pointer)
- func (m *Map) PutSlot(typ *abi.SwissMapType, key unsafe.Pointer) unsafe.Pointer
- func (m *Map) Used() uint64
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcOldMapKeyError¶added ingo1.25.0
func OldMapKeyError(t *abi.OldMapType, punsafe.Pointer)error
Types¶
typeIter¶
type Iter struct {// contains filtered or unexported fields}
func (*Iter)Elem¶
Key returns a pointer to the current element. nil indicates end ofiteration.
Must not be called prior to Next.
func (*Iter)Init¶
func (it *Iter) Init(typ *abi.SwissMapType, m *Map)
Init initializes Iter for iteration.
func (*Iter)Initialized¶
typeMap¶
type Map struct {// contains filtered or unexported fields}
Note: changes here must be reflected in cmd/compile/internal/reflectdata/map_swiss.go:SwissMapType.
funcNewEmptyMap¶
func NewEmptyMap() *Map
funcNewMap¶
If m is non-nil, it should be used rather than allocating.
maxAlloc should be runtime.maxAlloc.
TODO(prattmic): Put maxAlloc somewhere accessible.
func (*Map)Clear¶
func (m *Map) Clear(typ *abi.SwissMapType)
Clear deletes all entries from the map resulting in an empty map.
func (*Map)Get¶
Get performs a lookup of the key that key points to. It returns a pointer tothe element, or false if the key doesn't exist.