Experimenting with project templates (go.dev)
from deckard@lemmy.ndlug.org to golang@programming.dev on 31 Jul 2023 21:09
https://lemmy.ndlug.org/post/8678

Today we published gonew, an experimental tool for instantiating new projects in Go from predefined templates.

$ go install golang.org/x/tools/cmd/gonew@latest

threaded - newest

BravoVictor@programming.dev on 31 Jul 2023 21:41 next collapse

Interesting. I’ve never personally had too many issues with startup. I actually thought Golang already had something like this built-in with ‘go mod init’. Looks like i was wrong…

Having boilerplate does help.

Cobra CLI is pretty great if you will only be using your binary on the cli.

tedu on 01 Aug 2023 02:27 next collapse

I usually forget something basic like "package main" when starting with a totally blank file, which isn't hard to fix, but is probably frustrating when you're just looking at a syntax error with no experience.

spacedogroy@feddit.uk on 01 Aug 2023 06:36 collapse

I must be grumpy because when I saw the blog post I thought it was kind of dumb when git clone gives you all you need and is universal. It felt a bit like a needless solution.

That being said, integration into gopls and IDE: yes please and thank you. 👍