util

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unwrap

func Unwrap(expr ast.Expr) *ast.Ident

Types

type BiMap

type BiMap[L, R comparable] struct {
	// contains filtered or unexported fields
}

func NewBiMap

func NewBiMap[L, R comparable]() BiMap[L, R]

func (BiMap[L, R]) GetByL

func (bm BiMap[L, R]) GetByL(key L) (rv R, ok bool)

func (BiMap[L, R]) GetByR

func (bm BiMap[L, R]) GetByR(r R) (lv L, ok bool)

func (BiMap[L, R]) LMap

func (bm BiMap[L, R]) LMap() map[L]R

func (BiMap[L, R]) MustPut

func (bm BiMap[L, R]) MustPut(l L, r R)

Put l and r into map,

MustPut panic if either l or r is already mapped to other value

func (BiMap[L, R]) Put

func (bm BiMap[L, R]) Put(l L, r R) (ok bool)

Put l and r into map,

put report false if either l or r is already mapped to other value

Jump to

Keyboard shortcuts

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