From: Andrew Gerrand Date: Thu, 28 Oct 2010 21:48:16 +0000 (+1100) Subject: container/list: document iteration X-Git-Tag: weekly.2010-11-02~44 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6062515a9387f93bf21eae574a407e49016ed712;p=gostls13.git container/list: document iteration R=rsc CC=golang-dev https://golang.org/cl/2768042 --- 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.