In-reply-to » I've started playing with Go today, just understood the basics and still a bit confused about the module and goroutine parts.

@justamoment@twtxt.net @eaplmx@twtxt.net Modules are a bit weird, indeed. In fact, you can name your module differently than the directory name. To the extreme, you can have a directory “foo”, but call the module “bar” and call the “bar” directory your module “foo”. Not sure why anyone wants that, but there you have it.

However, when it comes to nested modules, I believe the “prefix” path components must match the directory names or else Go won’t find anything. So I recommend to always make the module name and directory name the same. That also puts much less cognitive work on yourself. :-)

Basically think of goroutines as lightweight threads.

⤋ Read More