Soo ,
It Started With a Bug
Not a glamorous bug. Not a memory leak or a race condition. No, this was the most mundane bug of all: we forgot to restart the server after changing a handler.
Three hours wasted. Three hours of staring at the screen, questioning our sanity, questioning our code, questioning whether the universe was personally against us.
"F5! F5! F5!" we screamed at our keyboards. But nothing happened. Because we'd forgotten to restart.
The Problem No One Talks About
Here's the thing about Go development: it's fantastic. Type-safe, fast, great concurrency model. But when it comes to iteration speed? Eh.
You change code. You press Ctrl+C. You rebuild. You run. You test. Repeat.
Now, I know what you're thinking: "Just use an existing live-reload tool!" And we did! For about sometime.
But here's the thing - every time we set up a new machine, there's that moment:
- "Wait, which tool are we using again?"
- "Let me check the README for setup instructions."
- "Why isn't this working? Oh, I need to install this first."
We're great fans of CLI tools. They do the job. But for our specific workflow, we wanted something different. So sometimes , it's custom. Something that works without much hassle , without much conversations, something that just WORKS the way it should be .
So we built GoWatcher:
- It's a library, not a tool you install separately
- It's in your go.mod, versioned with your code
- No setup docs to read, no config files to manage
- It's just... there, when you need it
The Lightbulb Moment
One night (okay, 2 AM - let's be honest), we're staring at our terminal, watching CLI crash for the third time that day, and we thought:
"What if... the app just reloaded itself?"
Not another CLI. Not another tool to install. What if it was just... a library?
A library you import. A library that's there in dev, gone in prod. A library that doesn't require a degree in .config.toml configuration to understand.
The Birth of GoWatcher
So we built it.
A simple, embeddable live-reload library. No external dependencies (well, just fsnotify - it's a good library, we're not monsters). No config files. No separate process to manage.
Just import and go.
import "github.com/cinfinit/gowatcher"
func main() {
gowatcher.Watch(".")
// rest of your app
}
That's it. That's the entire setup.
Why It Works (And Why You'll Love It)
Here's what we realized during this journey:
1. It's Just Code
No new tool to install on CI. No apt-get install xyz in your Dockerfile. It's a Go module. It's in your go.mod. It's versioned. It just... works.
2. Zero Prod Overhead
The magic of build tags means this code literally doesn't exist in production. Your users never know it was there. Your binaries stay lean.
3. Programmable
Want to run cleanup before reload? Add build flags? Pass args to your app? It's just code. You can do whatever you want.
4. It Just Works
No config. No .config.toml. No "make sure your ignore patterns are correct." It watches your tree, rebuilds on change, restarts. That's it.
The Real Reason We Built This
You know why we really built it?
Because we just wanted to focus on writing code, not setting up tooling.
We wanted new teammates to just... code. No "here's how you set up your environment" onboarding. No "make sure you have this tool installed" reminders. We wanted the tool to be there, already part of the project, when they clone it.
We just wanted to code.
And now we can. We write code. We save. It reloads. We test. We code more. No friction. EVEN good for AI :)
That's the dream, right?
The simplest thing is .. It just works. It's simple. It's fun.
If you've ever felt the F5 fatigue, give it a try. I promise, your F5 key will thank you.
GoWatcher: Because your time is better spent coding than pressing F5.
Top comments (0)