From 6062515a9387f93bf21eae574a407e49016ed712 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Fri, 29 Oct 2010 08:48:16 +1100 Subject: [PATCH] container/list: document iteration R=rsc CC=golang-dev https://golang.org/cl/2768042 --- src/pkg/container/list/list.go | 6 ++++++ 1 file changed, 6 insertions(+) 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.