Skip to content

TeamSorghum/go-common

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Go Reference

This repository contains the implementations of some commonly used libraries.

Development

Requirements:

  1. Install go version specified in go.mod and .tool-versions. You can use asdf to manage multiple versions.
  2. Install golangci-lint.
  3. Install mockgen. If you are using asdf to manage versions, execute asdf reshim golang after installing mockgen.
  4. Install wire. If you are using asdf to manage versions, execute asdf reshim golang after installing wire.
  5. Install container environment. You can choose either docker or podman.
  6. Execute the following commands to install git hooks:
  • Pre-commit hook will run checks and tests before committing: ln -s ../../githooks/pre-commit .git/hooks/
  • Commit-msg hook will check where commit message conforms to conventional commits: ln -s ../../githooks/commit-msg .git/hooks/

Test:

  1. cd deployments && cp .env.example .env and edit .env, then source .env.
  2. Launch containers cd deployments && docker compose up -d.
  3. Now you can run tests via go test command.