This repository provides resources for learning Go through project building.
-
Go
-
Download Go version
1.21.3
from the official download page. -
Install Go and add
C:\Go\bin
to your PATH:$env:Path += ";C:\Go\bin" go version
-
-
Docker
-
Download Docker Desktop from the official download page.
-
Install Docker and verify the installation:
docker version
-
-
Chocolatey
-
Install Chocolatey:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
-
-
Make
-
Install Make using Chocolatey:
choco install make
-
-
Go-Swagger
-
Install
go-swagger
:go install github.com/go-swagger/go-swagger/cmd/swagger@latest $env:Path += ";$(go env GOPATH)\bin" swagger --version
-
Remember to reopen PowerShell after each installation to ensure changes take effect.
-
Run the sql database stack services:
docker-compose -f deployment/docker-compose/docker-compose-x86.yml --profile sql_database up -d
-
Login to pgAdmin4 at
localhost:5050
(Email:pgadmin4@pgadmin.org
, Password:admin
). -
Create a connection to the existing Postgres database inside the Docker network with the Docker service name:
- Name:
go-programming-network
- Host:
postgres
- Name:
-
Run the NoSQL database stack services:
docker-compose -f deployment/docker-compose/docker-compose-x86.yml --profile nosql_database up -d
-
Login to Mongo Express at
localhost:8081
(User:admin
, Password:pass
).
Note: Mongo databases are created automatically when data is inserted.
Ensure Go version 1.21.3
is installed.
-
Create a new service module directory:
go mod init github.com/your_username/your_repository
-
Clone one of the following service directories to use as a Go service recommended template for web application:
-
Go Standard Library
go-bookstore
go-serverless-yt
-
Go Fiber
go-fiber-crm-basic
go-fiber-mongo-hrms
-
Update
application.yml
andapplication-deploy.yml
underservice-name/resource
.
You can use the following commands under service-name/Makefile
for the recommended web applications templates above:
make build
make run
make test
make coverage
make clean
make deploy
make destroy
Invoke API:
aws lambda invoke --function-name lambda-yt-example --cli-binary-format raw-in-base64-out --payload '{\"What is your name?\": \"Jim\",\"How old are you?\": 33}' output.txt
Documentation:
- Prepare zip file to deploy to AWS Lambda AWS Lambda Documentation