1. 9
    1. 6

      Unless I’m confused, this doesn’t appear to have any templating. I honestly don’t get it. You create a module, and then you run gonew path/to/example new/path/to/newname. What you get is a copy of example as newname. The module name is changed, but…that’s it? There’s no other templating. I don’t see much benefit here. (You can easily do 99.99% of this simply with git or cp can’t you?) That said, this is very new, and people are already asking for templating.

      As an alternative template tool (written in Go, but you can use it to create projects in any language), I’m a fan of springerle by @carlmjohnson.

      1. 3

        So far, it’s very similar to Rich Harris’s degit: https://github.com/Rich-Harris/degit#wait-isnt-this-just-git-clone---depth-1

        I think it could be helpful if it got some basic rewrite abilities. Springerle came after I made a Go CLI skeleton as a GitHub template and got sick of tweaking 5 different places after each clone. If it stays a pure clone and rename the go.mod, then yeah, it doesn’t add a ton versus git clone –depth 1. We’ll see. I do think it makes sense as a thing in the Go tool.

      2. 3

        I had the same confusion. I’m all for getting an MVP out to get feedback but I hunted through multiple templates and finally read the source of gonew before I realized it literally just copies while changing the module name. That’s not a MVP in my book.

        On the bright side I think that the source provides a nice example of ast based transformations in go: https://cs.opensource.google/go/x/tools/+/master:cmd/gonew/main.go;l=168

      3. 0

        Google making cp is different than pleb calling cp.

    2. 3

      A great thing about Go is that such a tool is not actually necessary. And I hope that it never will be.

      1. 1

        Yeah I don’t see the point of it so far.

    3. 1

      Something I don’t like with such tools is that they are frequently used by people new to a language/framework/… and don’t know what the generated code does, or worse, misunderstood, so it turns into something unmaintained.

      Upgrades and updates are then also a lot harder.

      I also don’t feel like starting your project is really hard in Go,

      On the other hand there is things I like. Some people, again especially new people are really bad at structuring code. For this that would be great. Especially if other people later on have to take a look at code for the first time. It can be nice to know where to look for things. While a template doesn’t prevent things from ending up in a weird place, they at least don’t start out that way.