a Go container combining a map with a reverse map
This package provides a map with a reverse map mechanism, i.e., it allows you to get the value by a given key and a key from a given value.
package main
import (
"fmt"
"github.com/rasteric/doublemap"
)
func main() {
m := doublemap.New[string, int]()
m.Set("first", 1)
m.Set("second", 2)
m.Set("third", 3)
v, _ := m.Get("first")
fmt.Println(v)
k, _ := m.ByValue(3)
fmt.Println(k)
}
See the reference for more information.
This package is provided under the permissive MIT License, please see the accompanying LICENSE agreement for more information.