Secrets

A Backend Application

Manage Dependency to go.mod

Update dependencies

go mod tidy

Autoindent and format code

For autoformat our sources, we only need to run one line for formating our code.

We only need to run the next line

gofmt -w source.go

or

gofmt -w path/to/your/application

Conventions in this project

  • Functions -> Use Pascal Case i.e.
func HelloWorld()...
  • Variables Use -> Camel Case i.e.
routerHandler := nil
  • Folders and init file have the same name i.e.
ls user/
# Output
  user.go
  ...
  ..
  .
  • ENV -> always have the next structure:
PATH=/something/path/bin/here:$PATH
DB_HOST=localhost
DB_PORT=12345