types

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dict

type Dict[T any] map[string]T

Dict is a generic key-value dictionary with string keys

func (*Dict[T]) Contains

func (d *Dict[T]) Contains(key string) bool

Contains returns true, when a key exists in the dictionary

func (*Dict[T]) Get

func (d *Dict[T]) Get(key string) *T

Get returns the corresponding value ptr for a given key, or nil if the key doesn't exist

func (*Dict[T]) GetDefault

func (d *Dict[T]) GetDefault(key string, defaultValue T) T

GetDefault returns the corresponding value for a given key from a dictionary if it exists, the default value if not

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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