---
title: "Discussion on \"Go Iterators: A Practical Guide to the iter Package\" | Hashnode"
description: "Discussion on \"Go Iterators: A Practical Guide to the iter Package\". How to write a custom Go iterator using iter.Seq and iter.Seq2, handle early termination, convert push to pull with iter.Pull, and avoid the yield traps."
url: "https://hashnode.com/posts/go-iterators-a-practical-guide-to-the-iter-package/69e74d0dc34cf3a3f7bc8ba4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Go Iterators: A Practical Guide to the iter Package](https://danilchenko.hashnode.dev/go-iterators-a-practical-guide-to-the-iter-package?utm_source=hashnode&utm_medium=feed)

How to write a custom Go iterator using iter.Seq and iter.Seq2, handle early termination, convert push to pull with iter.Pull, and avoid the yield traps.

Apr 21 · 10 min read · danilchenko.hashnode.dev  
Read the article

## Written by

[Maksim Danilchenko](https://hashnode.com/@dmaxdev)

@dmaxdev · Limassol, Cyprus

  
[View profile](https://hashnode.com/@dmaxdev)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
