Skip to content

zunkk/go-project-startup

Repository files navigation

go-project-startup

A framework for quickly starting a Go project

Table of Contents

Use the framework to build your own project

  1. Update the project information in the makefile
APP_NAME = go-project-startup
APP_DESC = go project startup template
BASE_PKG = github.com/zunkk
APP_PKG = $(BASE_PKG)/$(APP_NAME)
  1. Run update project information cmd
# This command will update the project name and go package
make reset-project-info

Quick run

# This command will compile the program and deploy the binary copy to the deployment package
make dev-package

# Start in terminal
./deploy/app start

# Background startup
./deploy/start.sh

Generate deploy package

# This command will compile the program and package the script and binary into a compressed package
make package

Tools

Generate db models code from db

Use sqlboiler to generate db models code.

  1. Create/Update db tables

  2. Update db information in build/sqlboiler.toml, default is Postgres

[psql]
dbname = "test"
host = "127.0.0.1"
port = 5432
user = "zunkk"
pass = "zunkk"
schema = "public"
sslmode = "disable"
  1. Update generate config
MODELS_PATH := ${PROJECT_PATH}/internal/core/model
DB_TYPE = psql
  1. Generate db models code
make generate-models

About

go project startup template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published