←
Jon Calhoun6,233 posts
Jon Calhoun avatar

Jon Calhoun

@joncalhoun

Teaching #golang & building fun projects • Want to learn Go? Try gophercises.com and usegolang.com

◷ Joined May 2008▧ 484 Photos and videos
Matt Boyle avatar
⟳ Jon Calhoun retweeted
Matt Boyle@MattJamesBoyle·1 Oct 2025

I'm hiring for senior Go engineers to join us at @ona_hq! If you are: - AI native; using tools like Cursor, Claude code and Ona daily. - Are excited about building AI agents and the mission control platform that they will run on, entirely in Go. - Have 3-5 years of production Go experience. - Are based in London (remote Europe available too for exceptional folks). Then I'd love to have a virtual coffee with you and see if there is a mutual fit here. Drop me a DM. NOTE: We cannot sponsor visas right now so if you are not already located in Europe then please do not message as there will not be any exceptions.

Jon Calhoun avatar
Jon Calhoun@joncalhoun·26 Sep 2025

"Mac usability is characterized by its user-friendly, intuitive interface..." says nobody ever when trying to disable reactions on all video apps. 😫

Jon Calhoun avatar
Jon Calhoun@joncalhoun·17 Sep 2025

Did you know that Go's encoding/json package isn't case-sensitive when parsing JSON keys? This is one of the defaults proposed to change in Go's new json/v2 package. #golang #json

Post attachment
Jon Calhoun avatar
Jon Calhoun@joncalhoun·16 Sep 2025

In Go, ExampleXxx functions double as docs & tests. ✅ Tests verify code is working by comparing the output. 📖 godocs embed runnable examples, making it easier for devs to get started. #golang #testing

Post attachmentPost attachmentPost attachment
Jon Calhoun avatar
Jon Calhoun@joncalhoun·15 Sep 2025

Example: Let's say I have 100 new PPP customers. That means I need to support 100 more users. If I don't have a support staff, chances are 100 PPP sales don't bring in enough $ to hire someone. Instead, I need to take time away from growing the biz to provide support. Not great. On the other hand, if I have a dedicated support person, 100 new customers probably won't overwhelm them, so PPP might be more viable here.

Jon Calhoun avatar
Jon Calhoun@joncalhoun·15 Sep 2025

Unpopular Opinion: Parity Purchasing Power (PPP) discounts are like free plans; they only make sense at a certain income/profit level. Otherwise they kill your ability to grow.

@levelsio@levelsio9 Sep 2025

Try remove your free plan Free plans are for VC funded companies, not bootstrapped You don't have the luxury of subsidizing the entire world's usage in the hope a tiny % converts

Post attachment
Jon Calhoun avatar
Jon Calhoun@joncalhoun·12 Sep 2025

💡 In Go tests, mark helper functions like assertEquals and doRequest with t.Helper() This causes the Go tooling to point to the line where the function was called rather than a line in the helper function, which makes it easier to debug a failing test. #golang

Post attachment
Jon Calhoun avatar
Jon Calhoun@joncalhoun·11 Sep 2025

There are two ways to create paths in Go depending on your needs. 👉 Constructing a file path in Go? Use filepath.Join from the path/filepath package to get OS-specific separators. 👉 Constructing a slash-seperated path, like a URL? Use path.Join from the path package to get the same results regardless of OS. These may appear to be identical if running a unix-based OS, but they will behave differently in a Windows environment. #golang

Post attachment
Jon Calhoun avatar
Jon Calhoun@joncalhoun·11 Sep 2025

Is there a #golang playground that simulates running code on Windows? Would be nice for demonstrating OS-specific differences, but I recognize it is a pretty niche.

Jon Calhoun avatar
Jon Calhoun@joncalhoun·10 Sep 2025

I'm guessing the blog posts just falsely assumed that it would work without testing, but hoping to verify that. The source code appears to use straight string matching via a map key.

Jon Calhoun avatar
Jon Calhoun@joncalhoun·10 Sep 2025

The CrossOriginProtection added in Go 1.25 doesn't appear to support wildcard subdomains (https://*.calhoun.io) for trusted origins, yet I've had a few people point me to blog posts that use a wildcard example. Am I missing something? #golang

Jon Calhoun avatar
Jon Calhoun@joncalhoun·9 Sep 2025

GoLand users - what are your favorite features and tips? I’ve been trying it out to do a bit of a comparison, but I want to hear from #golang developers who have been using it for a bit.

Jon Calhoun avatar
Jon Calhoun@joncalhoun·7 Sep 2025

The init() function in Go runs before main() or any tests. This makes it alluring to new developers for setting things up, but it has a few downsides: 1️⃣ It introduces hidden behavior. If someone imports a function with init in it, code runs without them ever realizing it and this can lead to bugs or confusion. 2️⃣ Using init almost always means using global variables, making testing and dependency injection harder 3️⃣ Multiple init functions can run in unpredictable order Instead, prefer explicit setup. #golang