aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2010-10-29 08:48:16 +1100
committerAndrew Gerrand <adg@golang.org>2010-10-29 08:48:16 +1100
commit6062515a9387f93bf21eae574a407e49016ed712 (patch)
tree3a1223da05f8a410434845f3bc7e6f40e399ae35
parent302b0ff942378bbb1d2940c8ee11326f5880d549 (diff)
downloadgo-6062515a9387f93bf21eae574a407e49016ed712.tar.gz
go-6062515a9387f93bf21eae574a407e49016ed712.zip
container/list: document iteration
R=rsc CC=golang-dev https://golang.org/cl/2768042
-rw-r--r--src/pkg/container/list/list.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/container/list/list.go b/src/pkg/container/list/list.go
index 578864dbe6..ddc8611819 100644
--- a/src/pkg/container/list/list.go
+++ b/src/pkg/container/list/list.go
@@ -3,6 +3,12 @@
// license that can be found in the LICENSE file.
// The list package implements a doubly linked list.
+//
+// To iterate over a list (where l is a *List):
+// for e := l.Front(); e != nil; e = e.Next() {
+// // do something with e.Value
+// }
+//
package list
// Element is an element in the linked list.