pair

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Pair data structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All added in v0.4.8

func All[T, V any](pairs []Pair[T, V]) iter.Seq2[T, V]

Create iterator from Pairs.

func MergeStrPairs

func MergeStrPairs[T any](p ...Pair[string, T]) map[string][]T

Merge StrPair into a map

Types

type Pair

type Pair[T any, V any] struct {
	Left  T
	Right V
}

Pair data structure

func New

func New[T any, V any](t T, v V) Pair[T, V]

func (Pair[T, V]) MapKV added in v0.4.9

func (p Pair[T, V]) MapKV() (T, V)

type StrPair added in v0.4.9

type StrPair = Pair[string, string]

Jump to

Keyboard shortcuts

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