Skip to content

gogjango/gjango

Folders and files

NameName
Last commit message
Last commit date
Apr 22, 2020
Apr 29, 2021
Feb 4, 2020
Feb 2, 2020
Apr 22, 2020
Dec 26, 2020
Apr 22, 2020
Apr 22, 2020
Apr 19, 2020
Apr 19, 2020
Apr 19, 2020
Apr 19, 2020
Apr 19, 2020
Apr 19, 2020
Apr 19, 2020
Apr 19, 2020
Apr 21, 2020
Apr 19, 2020
Apr 22, 2020
Mar 5, 2020
Apr 22, 2020
Apr 29, 2021
Apr 19, 2020
Apr 22, 2020
Feb 29, 2020
May 6, 2020
Feb 2, 2020
Feb 2, 2020
Feb 2, 2020
Apr 21, 2020
Apr 22, 2020
Oct 7, 2021
Oct 7, 2021
Apr 21, 2020

Repository files navigation

CircleCI Maintainability Test Coverage Go Report Card GitHub

golang gin with go-pg orm

An example project that uses golang gin as webserver, and go-pg library for connecting with a PostgreSQL database.

Get started

# postgresql config
cp .env.sample .env
source .env
# get dependencies and run
go get -v ./...
go run .

Tests and coverage

Run all tests

go test -coverprofile c.out ./...
go tool cover -html=c.out

# or simply
./test.sh

Run only integration tests

go test -v -run Integration ./...

./test.sh -i

Run only unit tests

go test -v -short ./...

# without coverage
./test.sh -s
# with coverage
./test.sh -s -c

Schema migration and cli management commands

# create a new database based on config values in .env
go run . create_db

# create our database schema
go run . create_schema

# create our superadmin user, which is used to administer our API server
go run . create_superadmin

# schema migration and subcommands are available in the migrate subcommand
# go run . migrate [command]