Goodbye .csproj, Hello go.mod
Right, let’s talk about dependencies. In .NET land, we’ve got NuGet, .csproj files, PackageReference …
A comprehensive guide for .NET developers making the jump to Go. From basic syntax to production deployment, this series covers everything you need to make the transition.
Whether you’re curious about Go or ready to make the switch, this series takes you through the journey from a .NET developer’s perspective. Each post compares familiar C# concepts with their Go equivalents, helping you build on what you already know.
Right, let’s talk about dependencies. In .NET land, we’ve got NuGet, .csproj files, PackageReference …
Before we get into the weeds of types and patterns, let’s establish some vocabulary. Go uses different names for …
After twenty-odd years writing C#, I’m learning Go. Not because .NET has failed me (it hasn’t) but because …
Go shipped generics in version 1.18 (March 2022). C# has had them since 2.0 (November 2005). That’s a …
Go doesn’t have enums. Not “Go has something enum-like”. It genuinely doesn’t have a dedicated …
Tony Hoare called null references his “billion dollar mistake.” Both C# and Go inherited some form of this …
Coming from C#, one of the first things you’ll notice is that Go structs look… naked. Where are the { get; …
Here’s something that’ll feel wrong for about a week: Go doesn’t have classes. Not “Go has …
Let’s address the elephant in the room. You’re going to write if err != nil hundreds of times. Thousands, …
So Go doesn’t have exceptions. Except… it kind of does. They’re called panic and recover, and they …
C#’s switch statement has evolved a lot over the years. Pattern matching, switch expressions, when guards. …
Right, let’s talk about pointers. If you’ve spent your career in C#, you’ve probably used pointers …
Every C# developer coming to Go makes the same mistake: they see []int and think “array” or …
In C#, you mostly don’t think about where variables live. Value types go on the stack (usually). Reference types …
Go’s concurrency model is going to feel backwards. You’ve spent years learning that async operations need …
If goroutines are Go’s lightweight threads, channels are how they talk to each other. Think …
Every Go function that does I/O, might take a while, or should be cancellable will take a context.Context as its first …
Go’s mantra is “share memory by communicating,” but sometimes you just need a bloody mutex. The sync …
The select statement is where Go’s channel system goes from “neat” to “powerful.” It lets …
We’ve all heard “favour composition over inheritance.” We’ve all nodded sagely. And then …
Here’s a sentence that’ll make every C# developer uncomfortable: Go interfaces don’t require an …
Go has a type called any. Before Go 1.18, it was written interface{}. Same thing, nicer name. And it’s basically …
Here’s something that surprised me: Go has built-in benchmarking. No BenchmarkDotNet to install. No configuration. …
In C#, you reach for Moq or NSubstitute without thinking. Interface? Mock it. Verify calls? Easy. Set up return values? …
Most Go projects have one go.mod file at the root. One module, one version, simple. But what happens when your repo …
So you’ve got the basics. You can write Go code. Now you need to organise it into something that won’t …
In C#, you pick a test framework: xUnit, NUnit, MSTest. You install packages. You learn attributes. You configure test …
In ASP.NET Core, configuration is a whole subsystem. IConfiguration, IOptions<T>, IOptionsSnapshot<T>, …
Entity Framework is an ORM. It maps objects to tables, generates SQL, tracks changes, handles migrations. You can build …
Visual Studio’s debugger is exceptional. Breakpoints, watch expressions, edit-and-continue, conditional …
Go developers love code generation. Where C# uses reflection, attributes, and source generators, Go often uses tools …
Despite Go’s “just write SQL” culture, ORMs exist and are popular. GORM is the most widely used. If …
ASP.NET Core is a sophisticated web framework. Dependency injection, middleware pipelines, model binding, routing with …
In C#, you add [JsonProperty("name")] or rely on naming conventions. The serializer figures out the rest. …
In C#, code formatting is a matter of preference. Tabs or spaces? Braces on the same line or next? Teams debate, …
For years, Go’s logging story was “use the log package or pick a third-party library.” The standard …
If you’ve run .NET on Lambda, you know the cold start pain. 3-5 seconds for a managed runtime. Even Native AOT …
Go’s static binaries make for tiny Docker images. Where a .NET container might be 200MB+, a Go container can be …
CI/CD for Go projects is refreshingly simple. Fast builds, built-in testing, cross-compilation. Everything you need is …
We touched on health checks in the Kubernetes post. Let’s go deeper. Proper health checks that actually tell …
Kubernetes is written in Go. The CLI tools are Go. The ecosystem is Go. Running Go services on Kubernetes feels natural. …
Observability in production means three things: metrics (what’s happening), traces (how requests flow), and logs …
Go binaries are already small compared to .NET self-contained deployments. But sometimes you want smaller: Lambda …
What sold me on Go for production: you build a binary, you copy it to a server, you run it. No runtime to install. No …
Versioning in Go is simple in concept (semantic versioning with git tags) but has quirks that’ll catch you if …
I’ve been writing Go full-time for a couple of months now. I like it. I’m productive. But let’s be …
Last time I talked about what I miss from C#. Now let’s flip it: what has Go given me that I’d properly …
Six months ago, I started this series with a simple goal: document learning Go as an experienced C# developer. Not a …