Skip to content

carlosgonzalez/go-bundled

Repository files navigation

CI

Simple Golang Setup with Echo, GORM, Testify and Mockery

Description

This project aims to provide a straightforward setup for beginners who want to explore Golang.

Whether you’re new to programming or just diving into Go, this repository will help you get started with essential concepts and tools.

Features

Routing with Echo

Learn how to set up routes and handle HTTP requests using the Echo framework.

Using GORM as an ORM

Understand how to interact with databases using GORM, a powerful Go ORM library.

Concurrency with Channels and Goroutines

Explore Go’s concurrency model by using channels and goroutines effectively.

Project Structure

go-bundled/
┣ .github/
┃ ┣ workflows/
┃ ┗ dependabot.yml
┣ internal/
┃ ┣ handlers/
┃ ┣ middlewares/
┃ ┣ models/
┃ ┣ repositories/
┃ ┗ services/
┣ mocks/
┃ ┗ mock_UserRepositoryInterface.go
┣ pkg/
┃ ┗ validators/
┣ tmp/
┃ ┣ build-errors.log
┃ ┗ main
┣ .air.toml
┣ .gitignore
┣ .mockery.yaml
┣ README.md
┣ docker-compose.yml
┣ go.mod
┣ go.sum
┗ main.go

Testing

Learn how to write unit tests for your Go code to ensure reliability with Testify and Mockery.

CI

Integrate linters (such as golangci-lint) to maintain code quality.

Installation

Make sure you have Go installed on your system. If not, download it from here.

Clone this repository:

git clone git@github.com:carlosgonzalez/go-bundled.git

Navigate to the project directory:

cd go-bundled

Install dependencies:

go mod tidy

Mockery

go install github.com/vektra/mockery/v2@v2.42.0

Install air if you want to have live-reload capabilities

go install github.com/cosmtrek/air@latest

Usage

Run the application:

docker-compose up -d

if you have air installed, run:

air

otherwise simply run with

go run .

Generate mocks with Mockery

mockery --all

Contributing

Contributions are welcome! If you find any issues or want to enhance the project, feel free to submit a pull request.

About

Simple Golang Setup with Echo, GORM, Testify and Mockery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages