@@ -11,4 +11,4 @@ import "context"
type Executor interface {
// Go starts a new goroutine controlled by the context
Go(handler func(ctx context.Context))
-}
+}
@@ -12,4 +12,4 @@ type Map struct {
// NewMap creates a thread safe Map
func NewMap() *Map {
return &Map{}
@@ -31,4 +31,3 @@ func (m *Map) Store(key interface{}, elem interface{}) {
m.data[key] = elem
m.lock.Unlock()
}
-
@@ -1,8 +1,8 @@
package concurrent_test
import (
- "testing"
"github.com/modern-go/concurrent"
+ "testing"
)
func TestMap_Load(t *testing.T) {
@@ -15,4 +15,4 @@ func TestMap_Load(t *testing.T) {
if value != "world" {
t.Fail()
@@ -4,9 +4,9 @@ import (
"context"
"fmt"
"runtime"
+ "runtime/debug"
"sync"
"time"
- "runtime/debug"
// LogInfo logs informational message, for example