github.com/searKing/golang/go@v1.2.117/exp/maps/map_reference_test.go (about)

     1  // Copyright 2023 The searKing Author. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package maps_test
     6  
     7  // This file contains reference map implementations for unit-tests.
     8  
     9  // mapInterface is the interface Map implements.
    10  type mapInterface[K comparable] interface {
    11  	Load(keys []K) (any, bool)
    12  	Store(keys []K, value any)
    13  	LoadOrStore(keys []K, value any) (actual any, loaded bool)
    14  	LoadAndDelete(keys []K) (value any, loaded bool)
    15  	Delete(keys []K)
    16  	Swap(keys []K, value any) (previous any, loaded bool)
    17  	CompareAndSwap(keys []K, old, new any) (swapped bool)
    18  	CompareAndDelete(keys []K, old any) (deleted bool)
    19  	Range(func(keys []K, value any) (shouldContinue bool))
    20  }