brew install go
brew install golang-migrate
migrate create -ext sql -dir database/migrations -seq create_users_table
make db.migrate
Install go-enum
curl -fsSL "https://github.com/abice/go-enum/releases/download/v0.6.0/go-enum_$(uname -s)_$(uname -m)" -o go-enum
chmod +x go-enum (Not required maybe)
go mod tidy
go run main.go
go run workers/main.go
.zshrc
export GOPATH=$HOME/go
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
go install github.com/hibiken/asynq/tools/asynq@latest
cd $GOPATH/bin
asynq dash
note that --sqlint
is only for enums of DB model that need enum attribute to be present as string but stored as int
in DB
./go-enum --sqlint --marshal -f ./enums/{path_to_enum_file}