Tao Wen 7 gadi atpakaļ
vecāks
revīzija
4da403eec3
5 mainītis faili ar 5 papildinājumiem un 6 dzēšanām
  1. 1 1
      executor.go
  2. 1 1
      go_above_19.go
  3. 0 1
      go_below_19.go
  4. 2 2
      map_test.go
  5. 1 1
      unbounded_executor.go

+ 1 - 1
executor.go

@@ -11,4 +11,4 @@ import "context"
 type Executor interface {
 type Executor interface {
 	// Go starts a new goroutine controlled by the context
 	// Go starts a new goroutine controlled by the context
 	Go(handler func(ctx context.Context))
 	Go(handler func(ctx context.Context))
-}
+}

+ 1 - 1
go_above_19.go

@@ -12,4 +12,4 @@ type Map struct {
 // NewMap creates a thread safe Map
 // NewMap creates a thread safe Map
 func NewMap() *Map {
 func NewMap() *Map {
 	return &Map{}
 	return &Map{}
-}
+}

+ 0 - 1
go_below_19.go

@@ -31,4 +31,3 @@ func (m *Map) Store(key interface{}, elem interface{}) {
 	m.data[key] = elem
 	m.data[key] = elem
 	m.lock.Unlock()
 	m.lock.Unlock()
 }
 }
-

+ 2 - 2
map_test.go

@@ -1,8 +1,8 @@
 package concurrent_test
 package concurrent_test
 
 
 import (
 import (
-	"testing"
 	"github.com/modern-go/concurrent"
 	"github.com/modern-go/concurrent"
+	"testing"
 )
 )
 
 
 func TestMap_Load(t *testing.T) {
 func TestMap_Load(t *testing.T) {
@@ -15,4 +15,4 @@ func TestMap_Load(t *testing.T) {
 	if value != "world" {
 	if value != "world" {
 		t.Fail()
 		t.Fail()
 	}
 	}
-}
+}

+ 1 - 1
unbounded_executor.go

@@ -4,9 +4,9 @@ import (
 	"context"
 	"context"
 	"fmt"
 	"fmt"
 	"runtime"
 	"runtime"
+	"runtime/debug"
 	"sync"
 	"sync"
 	"time"
 	"time"
-	"runtime/debug"
 )
 )
 
 
 // LogInfo logs informational message, for example
 // LogInfo logs informational message, for example