...

Source file src/github.com/modern-go/concurrent/map_test.go

Documentation: github.com/modern-go/concurrent

     1  package concurrent_test
     2  
     3  import (
     4  	"github.com/modern-go/concurrent"
     5  	"testing"
     6  )
     7  
     8  func TestMap_Load(t *testing.T) {
     9  	m := concurrent.NewMap()
    10  	m.Store("hello", "world")
    11  	value, found := m.Load("hello")
    12  	if !found {
    13  		t.Fail()
    14  	}
    15  	if value != "world" {
    16  		t.Fail()
    17  	}
    18  }
    19  

View as plain text