Browse Source

Tweak godoc

Evan Huus 11 năm trước cách đây
mục cha
commit
197b9db7ad
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      queue.go

+ 4 - 3
queue.go

@@ -11,17 +11,18 @@ package queue
 
 const minQueueLen = 16
 
+// Queue represents a single instance of the queue data structure.
 type Queue struct {
 	buf               []interface{}
 	head, tail, count int
 }
 
-// New constructs and returns a new Queue
+// New constructs and returns a new Queue.
 func New() *Queue {
 	return &Queue{buf: make([]interface{}, minQueueLen)}
 }
 
-// Length returns the number of elements currently stored in the queue
+// Length returns the number of elements currently stored in the queue.
 func (q *Queue) Length() int {
 	return q.count
 }
@@ -41,7 +42,7 @@ func (q *Queue) resize() {
 	q.buf = newBuf
 }
 
-// Add puts an element on the end of the queue
+// Add puts an element on the end of the queue.
 func (q *Queue) Add(elem interface{}) {
 	if q.count == len(q.buf) {
 		q.resize()