maps

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package maps contains functions for manipulating maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Keys

func Keys[K comparable, V any](m map[K]V) []K

Keys returns the keys of m as a slice.

func Values

func Values[K comparable, V any](m map[K]V) []V

Values returns the values of m as a slice.

Types

type Set

type Set[T comparable] map[T]struct{}

Set implements sets.Set for map[T]struct{}.

func (Set[T]) Add

func (s Set[T]) Add(item T)

func (Set[T]) Contains

func (s Set[T]) Contains(item T) bool

func (Set[T]) Iterate

func (s Set[T]) Iterate() iterator.Iterator[T]

func (Set[T]) Len

func (s Set[T]) Len() int

func (Set[T]) Remove

func (s Set[T]) Remove(item T)

Jump to

Keyboard shortcuts

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