Comment

Comment by simpleglider

Small bug irrelevant to the main point of the article: The very last golang example has a leak. If the timeout does occur, main will exit after a timeout and the spawned go routine will hang on the channel push.

I think the easiest fix is to make the channel buffered. "make(chan string)" => "make(chan string, 1)" Not sure if there is a more idiomatic golang way to accomplish this.

parent simpleglider 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton