techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.9K
active users
Jonathan Hall<p>Here&#39;s my write-up on what I would do to improve this code:</p><p><a href="https://boldlygo.tech/archive/2025-03-31-whats-wrong-with-this-code-answered/" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="ellipsis">boldlygo.tech/archive/2025-03-</span><span class="invisible">31-whats-wrong-with-this-code-answered/</span></a></p>
Jonathan Hall<p>How many problems or improvements can you spot in this real-world <a href="https://techhub.social/tags/Go" class="mention hashtag" rel="tag">#<span>Go</span></a> code example?</p><p>Hint: It works as intended, so it&#39;s not bugs, per se, I&#39;m looking for.</p><p><a href="https://techhub.social/tags/golang" class="mention hashtag" rel="tag">#<span>golang</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="tag">#<span>programming</span></a> <a href="https://techhub.social/tags/quiz" class="mention hashtag" rel="tag">#<span>quiz</span></a> <a href="https://techhub.social/tags/coding" class="mention hashtag" rel="tag">#<span>coding</span></a></p>
Jonathan Hall<p>Something cheesy is going on with AI...<br /> <a href="https://www.bbc.com/news/articles/cx2j15r1g09o" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://www.</span><span class="ellipsis">bbc.com/news/articles/cx2j15r1</span><span class="invisible">g09o</span></a></p>
Jonathan Hall<p>Next week we&#39;ll be recording the 100th episode of the Cup o&#39; Go podcast. Join us, live!</p><p><a href="https://riverside.fm/studio/cup-o-go" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="">riverside.fm/studio/cup-o-go</span><span class="invisible"></span></a><br /><a href="https://youtube.com/@cupogo" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="">youtube.com/@cupogo</span><span class="invisible"></span></a><br /><a href="https://www.twitch.tv/boldlygotech" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://www.</span><span class="">twitch.tv/boldlygotech</span><span class="invisible"></span></a></p><p><a href="https://techhub.social/tags/go" class="mention hashtag" rel="tag">#<span>go</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="tag">#<span>programming</span></a> <a href="https://techhub.social/tags/podcast" class="mention hashtag" rel="tag">#<span>podcast</span></a></p>
Jonathan Hall
Jonathan Hall<p>Thinking of learning <a href="https://techhub.social/tags/Golang" class="mention hashtag" rel="tag">#<span>Golang</span></a> in 2025?</p><p>Join my daily email list, along with over 900 others!</p><p><a href="https://boldlygo.tech/daily/" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="">boldlygo.tech/daily/</span><span class="invisible"></span></a></p>
Jonathan Hall<p>Thanks to everyone who responded! The correct answer is &quot;it depends&quot;.</p><p>Within a function, the code is invalid (with one exception, see the link), because `a` referenced before it&#39;s declared. However, at package scope, the code is valid, because initialization doesn&#39;t happen in lexographical order. Something which was new to me!</p><p>Full explanation here: <a href="https://boldlygo.tech/archive/2024-11-08-initialization-of-package-variables/" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="ellipsis">boldlygo.tech/archive/2024-11-</span><span class="invisible">08-initialization-of-package-variables/</span></a></p>
Jonathan Hall<p>Is the following <a href="https://techhub.social/tags/Go" class="mention hashtag" rel="tag">#<span>Go</span></a> code valid?</p><p>var x = a<br />var a = 3<br />var _ = x</p><p>I&#39;ll have the answer and full explanation in tomorrow&#39;s Boldly Go: Daily email. <a href="https://boldlygo.tech/daily/" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="">boldlygo.tech/daily/</span><span class="invisible"></span></a></p><p><a href="https://techhub.social/tags/golang" class="mention hashtag" rel="tag">#<span>golang</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="tag">#<span>programming</span></a> <a href="https://techhub.social/tags/quiz" class="mention hashtag" rel="tag">#<span>quiz</span></a></p>
Jonathan Hall<p>I&#39;m left wondering what the average bill is in Amsterdam for waterboarding.</p>
Jonathan Hall
Jonathan Hall
Jonathan Hall
Jonathan Hall<p>As a follow-up, I wrote a longer blog post describing my first experience with Go 1.23&#39;s range-over-func feature.</p><p><a href="https://techhub.social/tags/golang" class="mention hashtag" rel="tag">#<span>golang</span></a> <a href="https://techhub.social/tags/go" class="mention hashtag" rel="tag">#<span>go</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="tag">#<span>programming</span></a> </p><p><a href="https://boldlygo.tech/posts/2024-07-18-range-over-func/" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="ellipsis">boldlygo.tech/posts/2024-07-18</span><span class="invisible">-range-over-func/</span></a></p>
Jonathan Hall<p>Yesterday I decided to play around with Go 1.23&#39;s upcoming function iterators.</p><p>I have to say I&#39;m a convert.</p><p>Before starting, my expectation was that writing the iterators would be somewhat painful, but that using them would be very nice.</p><p>After writing 5 of them in an afternoon, for an actual real-world project, I can say that writing them is also quite easy. And once you understand the mental model of what&#39;s happening, it&#39;s quite intuitive.</p><p>My other preconceived misgiving was the ugly names of the interfaces. In particular, iter.Seq2. And while I still think that&#39;s a stupidly ugly name... you don&#39;t have to care (or even know) about that name to either write or consume iterators. So it&#39;s pretty much a non-issue.</p><p>So first impressions: I&#39;m a big fan.</p><p><a href="https://techhub.social/tags/go" class="mention hashtag" rel="tag">#<span>go</span></a> <a href="https://techhub.social/tags/golang" class="mention hashtag" rel="tag">#<span>golang</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="tag">#<span>programming</span></a></p>
Jonathan Hall<p>It wasn&#39;t that long ago that I celebrated sending my daily Go email to 600 people for the first time.</p><p>Well, today it went to 703!</p><p>Interested in learning about Go in bite-sized snippets, 5 days a week? Then you should join, too!</p><p><a href="https://techhub.social/tags/go" class="mention hashtag" rel="tag">#<span>go</span></a> <a href="https://techhub.social/tags/golang" class="mention hashtag" rel="tag">#<span>golang</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="tag">#<span>programming</span></a></p><p><a href="https://boldlygo.tech/daily/" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="">boldlygo.tech/daily/</span><span class="invisible"></span></a></p>
Jonathan Hall<p>I&#39;ll be live streaming again today! But this time it&#39;s a bit different.</p><p>I found a bug in the Go standard library! 😲</p><p>So on today&#39;s live stream, I&#39;ll be coming up with a minimal reproducible case, and filing a bug report. And hopefully also submitting a patch to fix the bug!</p><p>Join me!</p><p><a href="https://techhub.social/tags/Go" class="mention hashtag" rel="tag">#<span>Go</span></a> <a href="https://techhub.social/tags/golang" class="mention hashtag" rel="tag">#<span>golang</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="tag">#<span>programming</span></a> <a href="https://techhub.social/tags/bugreport" class="mention hashtag" rel="tag">#<span>bugreport</span></a> <a href="https://techhub.social/tags/opensource" class="mention hashtag" rel="tag">#<span>opensource</span></a> <a href="https://techhub.social/tags/livestream" class="mention hashtag" rel="tag">#<span>livestream</span></a></p><p><a href="https://youtube.com/live/INH-_HPGktA" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="">youtube.com/live/INH-_HPGktA</span><span class="invisible"></span></a></p>
Jonathan Hall
Jonathan Hall
Jonathan Hall
Jonathan Hall<p>Did you know that I do <a href="https://techhub.social/tags/TDD" class="mention hashtag" rel="tag">#<span>TDD</span></a> imperfectly?</p><p>I love TDD, but I almost _never_ do it perfectly by the book. Want proof? Join me in 30 minutes as I livestream, and make every mistake a human typically makes while coding. Including doing TDD &quot;all wrong&quot; at times.</p><p>I&#39;ll be working on my <a href="https://techhub.social/tags/OpenSource" class="mention hashtag" rel="tag">#<span>OpenSource</span></a> <a href="https://techhub.social/tags/Golang" class="mention hashtag" rel="tag">#<span>Golang</span></a> project. Bring your questions!</p><p><a href="https://youtube.com/live/E5nz4bNLRQg" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="">youtube.com/live/E5nz4bNLRQg</span><span class="invisible"></span></a></p>