summaryrefslogtreecommitdiff
path: root/example/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-18 15:13:40 -0500
committerJeff Carr <[email protected]>2025-03-18 15:13:40 -0500
commitce1f3200327edf89799dd1452899e01df5c6f593 (patch)
tree67b87ee5d588f3451d3c6ac3bda3e0e910f1421c /example/main.go
parent63a3d0dc2439802ca3bf8db92d095733db6b7b7e (diff)
add IterBy() functions
Diffstat (limited to 'example/main.go')
-rw-r--r--example/main.go6
1 files changed, 2 insertions, 4 deletions
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
}