- Platform: Udemy
- Instructor: Rajan Lagah
- Rating: 4.7/5
- Duration: 03:10:06
- Last Updated: March 2025
- Course Link: https://www.udemy.com/course/go-web-development-create-powerful-servers-with-golang
This document summarizes the key points from the course. I highly recommend watching the full course if you have the opportunity.
- I summarize key points from useful courses to learn and review quickly.
- Simply click on
Ask AIlinks to dive into any topic you want.
Teach Me: 5 Years Old | Beginner | Intermediate | Advanced | (reset auto redirect)
Learn Differently: Analogy | Storytelling | Cheatsheet | Mindmap | Flashcards | Practical Projects | Code Examples | Common Mistakes
Check Understanding: Generate Quiz | Interview Me | Refactor Challenge | Assessment Rubric | Next Steps
Rajan kicks off the course by explaining why big companies are moving to Go: it’s fast, memory-efficient, and perfect for building scalable backend services. He gives a high-level roadmap: start with a bare-bones Go server, add Gin for nicer routing, use Docker + PostgreSQL, build full CRUD APIs, add Google OAuth + JWT auth, and finally deploy everything to AWS with CI/CD in mind.
Example: You’ll end the course with a production-ready task-management API that runs on AWS, uses Google login, and talks to a real cloud database.
Learn how to download and install Go (1.23+), set up GOPATH, and write a classic “hello world” server using only the standard net/http package in ~15 lines.
Example:
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "OK")
})
log.Fatal(http.ListenAndServe(":8080", nil))
}Ask AI: Installing Go and first server
Rajan compares native net/http vs Gin and shows why Gin wins for real projects: automatic logging, easy JSON responses, built-in validation, middleware support, route grouping, and better performance.
Example:
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.JSON(200, gin.H{"message": "OK"})
})
r.Run(":8080")Never hard-code secrets! Rajan shows how to use godotenv to load a .env file and create a clean config package that’s loaded once at startup using init().
Example:
APP_PORT=8080
DB_PATH=postgres://postgres:adminpassword@localhost:5433/tasks?sslmode=disableAsk AI: Environment variables in Go
Learn why Docker is perfect for local databases (multiple versions, easy cleanup). Rajan provides a ready docker-compose.yml that spins up PostgreSQL 16 with a tasks database.
Example:
services:
postgres:
image: postgres:16.3
container_name: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: adminpassword
POSTGRES_DB: tasks
ports:
- "5433:5432"Ask AI: Docker PostgreSQL for Go
Stop restarting the server manually. Install air and watch your changes reflect instantly.
Example terminal command:
air
# → Server restarts automatically on every saveAsk AI: Live reload Go with Air
Build a /tasks POST route, use Gin’s binding + tags for validation, create migrations with golang-migrate, and separate queries into a repository layer.
Example validation:
type CreateTaskPayload struct {
Title string `json:"title" binding:"required,max=100"`
Description string `json:"description" binding:"required,max=1000"`
}Ask AI: CRUD Create and validation Gin
Finish the full CRUD set: route grouping, query parameters, PATCH with selective updates, and clean repository methods.
Example update payload:
type UpdateTaskPayload struct {
ID int `json:"id" binding:"required"`
Title *string `json:"title" binding:"omitempty,max=100"`
Description *string `json:"description" binding:"omitempty,max=1000"`
}Ask AI: CRUD Read Update Delete Gin
Set up a Google Cloud project, implement /login/google and /callback/google, exchange code for token, fetch user info, and sign your own JWT (24-hour expiry).
Example JWT generation:
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
"email": user.Email,
"name": user.Name,
"exp": time.Now().Add(time.Hour * 24).Unix(),
})
tokenString, _ := token.SignedString([]byte(config.JWT_SECRET))Create a reusable middleware that reads the Authorization: Bearer <token> header, verifies the JWT, and aborts with 403 if invalid/expired.
Example middleware:
func AuthMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
tokenString := c.GetHeader("Authorization")
if tokenString == "" || !strings.HasPrefix(tokenString, "Bearer ") {
c.AbortWithStatusJSON(403, gin.H{"error": "Unauthorized"})
return
}
// ...parse and verify token
c.Next()
}
}Install AWS CLI, create an IAM user with limited permissions, use eb init & eb deploy, configure Procfile, connect to AWS RDS PostgreSQL (private), and run migrations in production.
Example Procfile:
web: bin/application
Ask AI: Deploy Go to AWS Elastic Beanstalk RDS
About the summarizer
I'm Ali Sol, a Backend Developer. Learn more:
- Website: alisol.ir
- LinkedIn: linkedin.com/in/alisolphp