Socket
Book a DemoInstallSign in
Socket

github.com/sttk-go/orderedmap

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/sttk-go/orderedmap

Source
Go
Version
v1.0.0
Version published
Created
Source

orderedmap Go Reference CI Status MIT License

An ordered map for Golang.

This library provides the following functionalities:

  • A map which is like a Go standard map, and provide same methods with Go sync.Map except CompareAndDelete and CompareAndSwap. (Concurrent use is not supported.)
  • Front and Back methods that iterates map entries in the order of key insertions.
  • Ldelete and LoadAndLdelete methods for logical deletions, because Store and Delete are slower than Go standard map.
  • LoadOrStoreFunc method which stores a result of a give function when an entry for the specified key is not present.
  • MarshalJSON and UnmarshalJSON methods for JSON serialization and deserialization. These methods are implementations of json.Marshaler and json.Unmarshaler interfaces.

Importing this package

import "github.com/sttk/orderedmap"

Usage

The usage of this package is described on the overview in the go package document.

See https://pkg.go.dev/github.com/sttk/orderedmap#pkg-overview.

Supporting Go versions

This framework supports Go 1.18 or later.

Actual test results for each Go version:

% gvm-fav
Now using version go1.18.10
go version go1.18.10 darwin/amd64
ok  	github.com/sttk/orderedmap	0.136s	coverage: 99.3% of statements

Now using version go1.19.10
go version go1.19.10 darwin/amd64
ok  	github.com/sttk/orderedmap	0.132s	coverage: 99.3% of statements

Now using version go1.20.5
go version go1.20.5 darwin/amd64
ok  	github.com/sttk/orderedmap	0.137s	coverage: 99.3% of statements

Back to go1.20.5
Now using version go1.20.5

License

Copyright (C) 2023 Takayuki Sato

This program is free software under MIT License.
See the file LICENSE in this distribution for more details.

FAQs

Package last updated on 30 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts