Skip to content

Releases: m-murad/ordered-sync-map

Rewrite using generics, Go Module support

26 Mar 16:51
Compare
Choose a tag to compare
  • The package is now a go module and can be used as a dependency using
    go get github.com/m-murad/ordered-sync-map.
  • The whole package has been rewritten using generics. You can declare the type of keys and variables for the map.
import (
	osm "github.com/m-murad/ordered-sync-map"
)

func main() {
	mp := osm.New[string, string]()
}

Third release

24 Aug 07:57
Compare
Choose a tag to compare

This release adds the following -

m.GetOrPut(key interface{}, value interface{}) (finalValue interface{}, updated bool) - Retrive or Update the value for a key
m.GetAndDelete(key interface{}) (value interface{}, deleted bool) - Get value and delete the key from the Map

Second release

13 Aug 22:36
Compare
Choose a tag to compare

This release adds the following -

m.Length() - Returns the length of the Map.

Initial release

03 Aug 19:29
Compare
Choose a tag to compare

Initial release with following functions

m.New() - Will initialise a new Map.
m.Put(key interface{}, val interface{}) - Create/Update an entry in the Map.
m.Get() (value interface{}, ok bool) - Retrive value saved for a key.
m.Delete(key interface{}) bool - Delete an entry from the Map
m.UnorderedRange(f func(key interface{}, value interface{})) - Range over the Map in an unordered sequence.
m.OrderedRange(f func(key interface{}, value interface{})) - Range over the Map in the sequence in which elements were added.