Movatterモバイル変換


[0]ホーム

URL:


maps

packagestandard library
go1.25.2Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License:BSD-3-ClauseImports:5Imported by:0

Details

Repository

cs.opensource.google/go/go

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

Constants

This section is empty.

Variables

This section is empty.

Functions

funcOldMapKeyErroradded ingo1.25.0

func OldMapKeyError(t *abi.OldMapType, punsafe.Pointer)error

Types

typeIter

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

func (*Iter)Elem

func (it *Iter) Elem()unsafe.Pointer

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

func (it *Iter) Initialized()bool

func (*Iter)Key

func (it *Iter) Key()unsafe.Pointer

Key returns a pointer to the current key. nil indicates end of iteration.

Must not be called prior to Next.

func (*Iter)Map

func (it *Iter) Map() *Map

Map returns the map this iterator is iterating over.

func (*Iter)Next

func (it *Iter) Next()

Next proceeds to the next element in iteration, which can be accessed viathe Key and Elem methods.

The table can be mutated during iteration, though there is no guarantee thatthe mutations will be visible to the iteration.

Init must be called prior to Next.

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

func NewMap(mt *abi.SwissMapType, hintuintptr, m *Map, maxAllocuintptr) *Map

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)Cloneadded ingo1.25.0

func (m *Map) Clone(typ *abi.SwissMapType) *Map

func (*Map)Delete

func (m *Map) Delete(typ *abi.SwissMapType, keyunsafe.Pointer)

func (*Map)Get

func (m *Map) Get(typ *abi.SwissMapType, keyunsafe.Pointer) (unsafe.Pointer,bool)

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.

func (*Map)Put

func (m *Map) Put(typ *abi.SwissMapType, key, elemunsafe.Pointer)

func (*Map)PutSlot

func (m *Map) PutSlot(typ *abi.SwissMapType, keyunsafe.Pointer)unsafe.Pointer

PutSlot returns a pointer to the element slot where an inserted elementshould be written.

PutSlot never returns nil.

func (*Map)Used

func (m *Map) Used()uint64

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp