diff --git a/concurrency/iterator_error_handling/main.go b/concurrency/iterator_error_handling/main.go new file mode 100644 index 0000000..85803fe --- /dev/null +++ b/concurrency/iterator_error_handling/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "time" + + "github.com/davecgh/go-spew/spew" +) + +type FetchResult struct { + Domain string + StatusCode uint + Header string +} + +func dummyFetchUrl(url string) *FetchResult { + time.Sleep(time.Second * 1) + return &FetchResult{ + url, + 200, + "Dummy Header", + } +} + +func main() { + r := dummyFetchUrl("http://www.google.com") + spew.Dump(r) +}