---
title: "Hamed Yousefi (@hmdsefi) | Hashnode"
description: "Hamed Yousefi (@hmdsefi) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@hmdsefi"
---

@hmdsefi

# Hamed Yousefi

@hmdsefi · Dubai, UAE · Joined September 2026

## Comments

[Really useful post, thanks. Lesson 3 hit home for me: the slow endpoint is usually a missing index, and adding the index is cheaper than adding a cache. A small tip for lesson 5: staticcheck warns about a plain string as a context key, because another package can use the same string. An unexported key type avoids that: type requestIDKey struct{} ctx := context.WithValue(r.Context(), requestIDKey{}, id) And one I'd add to the list: set timeouts on http.Server itself, at least ReadHeaderTimeout. A slow client can hold a connection open while it sends headers, and that happens before the handler runs, so the context timeout from lesson 2 never starts.](https://hashnode.com/posts/7-lessons-i-learned-building-production-apis-in-go/6ac96753d8fd56894cb40ba6/comment/6aca137163ebfab1e9507885)

Comment · Article · Oct 10 · [7 Lessons I Learned Building Production APIs in Go](https://hashnode.com/posts/7-lessons-i-learned-building-production-apis-in-go/6ac96753d8fd56894cb40ba6)

[Thanks, good points. I agree on pairing the two. The "why" section touches on this: go mod why -m follows the package import graph, and the requirement graph shows which chain of go.mod files brought a module in. When you're deciding what to cut, the import chain is the one to act on. The pruning note is a useful addition. Since Go 1.17, the graph leaves out the deeper requirements of modules that declare go 1.17 or later, so the same project can show a much smaller graph than it did on older Go versions. Worth keeping in mind when comparing graph sizes across projects. And yes, the cycle in the article is a requirement cycle between the otel modules, which Go allows. An import cycle between packages is a compile error, so the compiler already catches that one.](https://hashnode.com/posts/finding-cycles-and-hidden-dependencies-in-go-mod-graph/6ac78c67ebf43b6f18027dbb/comment/6ac96489954062902cbd31ed#reply-6aca11a40064a2d68f9ccc1e)

Reply · Article · Oct 10 · [Finding cycles and hidden dependencies in go mod graph](https://hashnode.com/posts/finding-cycles-and-hidden-dependencies-in-go-mod-graph/6ac78c67ebf43b6f18027dbb)
