Skip to content
/ go-hexagonal Public template

A golang template project, using hexagonal architecture based on DDD

License

Notifications You must be signed in to change notification settings

RanchoCooper/go-hexagonal

Repository files navigation

Hexagonal Architecture Based On DDD

Architecture

Overview

Usage

Pre-commit Hook && Commitlint && Golangci-lint

manually install

# install pre-commit
brew install pre-commit
# install golangci-lint
brew install golangci-lint
# install commitlint
npm install -g @commitlint/cli @commitlint/config-conventional
# add commitlint config
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
# add pre-commit hook
make precommit.rehook

or just type

make init && make precommit.rehook

Environment Prepare

prepare mysql via docker

docker run --name mysql-local \                                                                                                                                     ✔  00:17:00 
  -e MYSQL_ROOT_PASSWORD=mysqlroot \
  -e MYSQL_DATABASE=go-hexagonal \
  -e MYSQL_USER=user \
  -e MYSQL_PASSWORD=mysqlroot \
  -p 3306:3306 \
  -d mysql:latest

Reference