This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net/http" | |
| ) | |
| // Result holds the result of a work function execution | |
| type Result struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "os" | |
| "time" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Package main demonstrates Go iterator patterns using the iter package. | |
| // This program showcases both built-in iterators from maps/slices packages | |
| // and custom iterator implementation. | |
| package main | |
| import ( | |
| "fmt" // for formatted output | |
| "iter" // for iterator types (Go 1.23+) | |
| "maps" // for map iterator utilities | |
| "slices" // for slice iterator utilities |
OlderNewer