Gofr (@gofr_dev) profile picture

An Opinionated Go Framework For accelerated microservice development Website : https://xitter.cf/t.co/b5U3SbivQt

Banglore, India
Joined September 2023
Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)Photo by Gofr (@gofr_dev)
Stop passing *sql.DB around. GoFr puts it on ctx: func getUser(ctx *gofr.Context) (any, error) { var n string err := ctx.SQL.QueryRowContext(ctx, "SELECT name FROM users WHERE id=?", ctx.PathParam("id")).Scan(&n) return n, err } DB from .env. Query metrics built in.
3
52
By default, Go's http.Get() has no timeout. If the server hangs, your request can wait forever. Set one yourself: client := &http.Client{ Timeout: 5 * time.Second, } resp, err := client.Get(url) Now a slow server costs you 5 seconds, not your whole service. #golang
4
37
Now that writing code is fast, what actually slows you down?
100%Reviewing the output
0%Deciding what to build
0%Debugging what shipped
0%Waiting on CI
3 votes • Final results
2
25
You do not need to nil check a Go map before reading it. var m map[string]string m["env"] -> "" len(m) -> 0 v, ok := m["x"] -> "", false for range m -> zero iterations All fine on a nil map. Only writing panics: m["env"] = "prod"
4
52
5 allocations, or 28. Same JSON. struct: 5 allocs, 304 B map[string]any: 28 allocs, 920 B A struct lets the decoder write straight into known fields. A map boxes every value it meets, one allocation at a time. Allocations are what your GC feels.
4
47
Golang's rise in developer adoption, 2017–2026 Simple syntax. Built-in concurrency. Fast compilation. Golang has steadily earned its place in modern backend engineering, from microservices to cloud infrastructure. Source: survey.stackoverflow.co #Golang #Backend #Developers
1
4
52
Does your Go service actually shut down gracefully?
50%Drains, bounded timeout
0%Drains, no timeout
50%Exits on SIGTERM
0%Never checked
2 votes • Final results
3
14
The classic Go production bug now has a profiler. goroutineleak profile: total 3 main.startWorker.func1 main.go:13 New in Go 1.27. A goroutine blocked on a channel that nothing can reach any more can never wake up, and the GC can prove it. /debug/pprof/goroutineleak
4
55
How are errors actually handled in your Go codebase?
100%Wrapped properly
0%Sentinel errors
0%Logged and swallowed
0%Mix of all three
2 votes • Final results
3
15
Go 1.27 put UUID in the standard library. import "uuid" No module path. No go get. Nothing in go.mod. New() for a v4. NewV7() for a time ordered UUID, which sorts by creation. Worth checking if you still need the dependency.
4
96
What breaks first when your backend takes real traffic?
60%DB connections
20%CPU/Memory
20%A downstream service
0%Something unexpected
5 votes • Final results
4
23
AI-written code compiles almost every time. It passes security tests 56% of the time (Veracode, 2026). Writing got cheap. Reviewing and running did not. Here is how I pair AI coding assistants with GoFr, in 5 steps:
3
1
4
101
a.WebSocket("/ws", h) in GoFr registers a GET route. curl it with no Upgrade header: GET /ws -> 400 POST /ws -> 404 GET /nope -> 404 The 400 is the handler refusing a non-upgrade request. Same Handler type as a.GET. No WebSocket type to learn.
5
152
Prod breaks. Logs on INFO. GoFr polls REMOTE_LOG_URL for: {"data":{"serviceName":"x","logLevel":"INFO"}} Change that to DEBUG on your endpoint and the live service picks it up. No restart. You host the endpoint. Set it up before you need it. gofr.dev/docs/advanced-guide… #golang
1
5
87
The hard part of putting an agent in front of your API is not wiring it up. It is bounding it. app.EnableMCP() That is the whole change. Your GoFr service is now an MCP server. An agent gets your read routes. Never your write routes.
1
4
82
How do your database migrations run? #database
50%On startup, in-process
0%Separate step pre-deploy
25%A migration job/init cont
25%Manually or AI agent
4 votes • Final results
3
26
Return an interface and you have quietly decided what your caller gets. Every other method is still on the value, just out of reach. Accept interfaces. Return structs.
5
46
Your Go struct can be bigger than the sum of its fields. Alignment adds padding. Field order decides how much. Group the small ones together. They often fit in padding that's already there. The compiler won't reorder them for you. #golang #performance
1
6
116
What are you using for inter-service communication?
25%REST / HTTP
25%gRPC
0%Message queue
50%All three
4 votes • Final results
2
40
GoFr v1.61.0 is out. This release brings: • Readiness checks that hold traffic with a 503 until your dependencies are ready • A new HTTP QUERY method (RFC 10008) • Health checks now run in parallel, 4x faster Full notes: github.com/gofr-dev/gofr/rel…
1
4
53