8 ms·
My biggest issue with navigating Go codebases is that sometimes it's cumbersome to find where a specific type/function is defined, when there are multiple files
by notafrog 7y ago
My biggest issue with navigating Go codebases is that sometimes it's cumbersome to find where a specific type/function is defined, when there are multiple files under the same directory.
- cmonfeat 7y agoI've had this issue as well and found that it makes using an IDE almost mandatory for large code bases.
- NateDad 7y agoA simple text search will find it every time. Since Go code should always be formatted, it's pretty trivial to search for `type HTTPServer` or `func NewServer(` ... even over fairly large codebases this will give few enough hits that you can just search everything most of the time.
- apta 7y agoNot to mention trying to figure out which types implement a given interface. You'll get completely unrelated types you don't care about a lot of the time.
- Lio 7y agoWould this not be solvable with something like ctags or godef? (I'm a newbie with Go so I've probably missed something in the problem you're describing).