# Going Backward: Reinventing Go's iterator

DevFeed: [Going Backward: Reinventing Go's iterator](<https://devfeed.tech/articles/going-backward-reinventing-go-s-iterator-60418.md>)

Original publisher: [Read original article](<https://antonz.org/going-backward/>)

Author: Anton Zhiyanov

Published: 2026-08-03T12:00:00Z

Content type: tutorial

Language: en

Sources: [Anton Zhiyanov](<https://devfeed.tech/sources/anton-zhiyanov.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code](<https://devfeed.tech/topics/code.md>), [function](<https://devfeed.tech/topics/function.md>), [callback](<https://devfeed.tech/topics/callback.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [callback](<https://devfeed.tech/tags/callback.md>), [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [generics](<https://devfeed.tech/tags/generics.md>), [go](<https://devfeed.tech/tags/go.md>), [go-development](<https://devfeed.tech/tags/go-development.md>), [implementation](<https://devfeed.tech/tags/implementation.md>)

## AI overview

An exploration of how to build a generic iterator in Go, progressing from reversing a copied slice to closure-based and callback-based implementations. It discusses memory use, calling style, and early termination.

## Source excerpt

Building a generic iterator wheel from scratch.