When do you decide to reach for an external package instead of stdlib
Ive been writing Go for a while now and I still struggle with this balance. The standard library is obviously great and covers a lot. But sometimes I see people pulling in external packages for things that seem doable with stdlib, just with more lines of code. For example, using a router like chi or gorilla mux instead of net/http, or using a validation library instead of writing manual checks. On one hand I get that external packages can save time and reduce bugs if theyre well tested. On the other hand every dependency adds maintenance overhead and potential security issues. I also see a lot of comments here that lean heavily toward stdlib whenever possible, almost like a badge of honor. But in real projects, deadlines exist and sometimes I just need something that works now without reinventing the wheel. Curious where other people draw the line. Do you have a rule of thumb for when to pull in an external package versus writing it yourself. Also how do you evaluate whether a package is worth the dependency cost, especially for smaller utilities. Does the existence of cgo in a package immediately disqualify it for you.
Posted Mar 6, 2026, 9:48 PM UTC