Don't use it for production!
$ go install golang.org/x/tools/cmd/gonew@latest
$ gonew github.com/stonear/go-template github.com/stonear/hello-world
That’s it! gonew
creates the directory for you, and uses the last part of the module name. In this case, that’s hello-world.
$ // create .env file
$ docker compose up -d
$ // dont forget to run migration for the first time (dbmate migrate)
$ dbmate n <your-migration-name>
$ dbmate migrate
$ dbmate down
$ make gen
$ make lint
Verb | URI | Action |
---|---|---|
GET | /entities | Index |
POST | /entities | Store |
GET | /entities/:id | Show |
PUT | /entities/:id | Update |
DELETE | /entities/:id | Destroy |
A typical git commit message will look like: <type>: <subject>
, "type" must be one of the following mentioned below:
build
: Build related changeschore
: A code change that external user won't see (eg: change to .gitignore file or .prettierrc file)feat
: A new featurefix
: A bug fixdocs
: Documentation related changesrefactor
: A code that neither fix bug nor adds a feature. (eg: You can use this when there is semantic changes like renaming a variable/ function name)perf
: A code that improves performancestyle
: A code that is related to stylingtest
: Adding new test or making changes to existing test
$ make test
Files with the suffix _test.go
are only compiled and run by the go test
tool.