Browse Source

fix some typo (#677)

heyanfu 4 years ago
parent
commit
a5962f677f

+ 1 - 1
core/queue/queue.go

@@ -71,7 +71,7 @@ func NewQueue(producerFactory ProducerFactory, consumerFactory ConsumerFactory)
 	return q
 }
 
-// AddListener adds a litener to q.
+// AddListener adds a listener to q.
 func (q *Queue) AddListener(listener Listener) {
 	q.listeners = append(q.listeners, listener)
 }

+ 1 - 1
core/stat/internal/cpu_linux.go

@@ -22,7 +22,7 @@ var (
 	cores     uint64
 )
 
-// if /proc not present, ignore the cpu calcuation, like wsl linux
+// if /proc not present, ignore the cpu calculation, like wsl linux
 func init() {
 	cpus, err := perCpuUsage()
 	if err != nil {

+ 1 - 1
core/syncx/managedresource.go

@@ -18,7 +18,7 @@ func NewManagedResource(generate func() interface{}, equals func(a, b interface{
 	}
 }
 
-// MarkBroken marks the resouce broken.
+// MarkBroken marks the resource broken.
 func (mr *ManagedResource) MarkBroken(resource interface{}) {
 	mr.lock.Lock()
 	defer mr.lock.Unlock()

+ 1 - 1
core/syncx/once.go

@@ -2,7 +2,7 @@ package syncx
 
 import "sync"
 
-// Once returns a func that guanartees fn can only called once.
+// Once returns a func that guarantees fn can only called once.
 func Once(fn func()) func() {
 	once := new(sync.Once)
 	return func() {

+ 1 - 1
core/syncx/onceguard.go

@@ -2,7 +2,7 @@ package syncx
 
 import "sync/atomic"
 
-// A OnceGuard is used to make sure a resouce can be taken once.
+// A OnceGuard is used to make sure a resource can be taken once.
 type OnceGuard struct {
 	done uint32
 }

+ 2 - 2
core/syncx/pool.go

@@ -19,7 +19,7 @@ type (
 
 	// A Pool is used to pool resources.
 	// The difference between sync.Pool is that:
-	//  1. the limit of the resouces
+	//  1. the limit of the resources
 	//  2. max age of the resources can be set
 	//  3. the method to destroy resources can be customized
 	Pool struct {
@@ -56,7 +56,7 @@ func NewPool(n int, create func() interface{}, destroy func(interface{}), opts .
 	return pool
 }
 
-// Get gets a resouce.
+// Get gets a resource.
 func (p *Pool) Get() interface{} {
 	p.lock.Lock()
 	defer p.lock.Unlock()

+ 1 - 1
core/syncx/refresource.go

@@ -8,7 +8,7 @@ import (
 // ErrUseOfCleaned is an error that indicates using a cleaned resource.
 var ErrUseOfCleaned = errors.New("using a cleaned resource")
 
-// A RefResource is used to reference counting a resouce.
+// A RefResource is used to reference counting a resource.
 type RefResource struct {
 	lock    sync.Mutex
 	ref     int32