Classic Programmer Facepalm Moment 🤦‍♂️

I just spent 10 minutes debugging something in Go, only to find out I was over-complicating things for no reason. Here’s what happened:

I had a variable MONGODB_URI declared in secrets.go (package config). In db.go (same package), I was calling it as config.MONGODB_URI. Turns out, because both files are in the same package, I didn’t need the config. prefix. I just needed to use MONGODB_URI directly.

Simple fix, but it had me scratching my head for way longer than I’d like to admit. 😂

Lesson learned: Sometimes it’s not a bug, just a little misunderstanding of how packages work.

What’s the funniest or most frustrating “oops” moment you’ve had while programming? Let’s hear it!