Hacker News new | past | comments | ask | show | jobs | submit login

Maybe a bit off-topic but does someone know of a good code scaffold generator for go? Something like rails new, and rails generate?



    go mod init

    touch main.go


It really depends on what you want to scaffold, but I took a minimal approach and use:

https://github.com/boourns/scaffold - generates a SQL select/insert/update layer, currently specifically for SQLite.

https://github.com/boourns/go-gql-typescript-example - an example project using scaffold for the model layer, https://gqlgen.com to generate the graphql layer, and typescript.

This is my currently preferred stack. Currently in my second year of working on a 25k LOC project in this stack and it has scaled up to meet those demands.


Go generate if I'm understanding you correctly?


Something like spf13/cobra?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: