Skip to content

a generic Go container combining a map with a reverse map

License

Notifications You must be signed in to change notification settings

rasteric/doublemap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Doublemap

a Go container combining a map with a reverse map

GoDoc Go Report Card

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.

Example usage

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.

License

This package is provided under the permissive MIT License, please see the accompanying LICENSE agreement for more information.

About

a generic Go container combining a map with a reverse map

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages