From ce1f3200327edf89799dd1452899e01df5c6f593 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 18 Mar 2025 15:13:40 -0500 Subject: add IterBy() functions --- example/main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'example') diff --git a/example/main.go b/example/main.go index 490421e..fe1b4f0 100644 --- a/example/main.go +++ b/example/main.go @@ -119,11 +119,9 @@ func (pb *Fruits) printTable() { func (pb *Fruits) sortTable(i int) { var count int - all := pb.SortByBrand() - for all.Scan() { - tmp := all.Next() + for fruit := range pb.IterByBrand() { count += 1 - log.Printf("found %d %s %s\n", count, tmp.Brand, tmp.City) + log.Printf("found %d %s %s\n", count, fruit.Brand, fruit.City) if count > i { break } -- cgit v1.2.3