I’ve started playing with Go today, just understood the basics and still a bit confused about the module and goroutine parts.

I’ll try to make something interesting soon.

⤋ Read More

@justamoment@twtxt.net I haven’t touched the goroutines yet (I played with these like 10 years ago), but I haven’t found a case where I need these.

About the modules, those were very non-intuitive to me, coming from Python, C#, and JS. I think the official documentation from Go is not clear enough and has no simple examples…
After a few searches, I reached Stack Overflow and blogs with tips for Modules and subdirectories. Now, I can replicate an MVC model with templates.

This project helped a lot: https://github.com/J7mbo/go-subdirectories-with-modules

⤋ Read More

@eaplmx@twtxt.net Thank you so much.

I got the fact that everything get bundled from a single folder but I too am used to properly specify what I want for every module since using Python/JS.

On my tries I managed to do local imports and compile with GO111MODULES but I was confused on the uses of that flag. Online everything mentioned the url as a reference to the source and I was missing the point of using it locally from a single project.

On a post the recommendation was to not use folder which is pretty bad in my opinion for a bigger project, also looking at yarn repo didn’t cleared up my doubts (too big for me right now 😓).

Thanks again!

⤋ Read More

@carsten@yarn.zn80.net So I wanted to reply to this Yarn with some comments, but wasn’t able to really do so whilst out ‘n about camping with the family 😅 – Basically Go’s modules (the more recent version) is actually pretty good. Let me try to help you understand the basics of it…

When defining a new package/library, run go mod init git.mills.io/prologic/foo (as an example). This could also be github.com/prologic/foo or anywhere else with a publicly accessible Git source. I recommend this as the easiest as things will “just work”™.

Next, never do development in $GOPATH as this is basically deprecated and gone now. Always code outside of $GOPATH and use modules as per above.

Finally if you are not ready to publish your work and you depend on foo and bar and maybe something else too (like Yarn.social’s codebase) then use $ go mod edit -replace git.mills.io/prologic/foo /User/prologic/Projects/foo (as an example).

⤋ Read More

Participate

Login to join in on this yarn.