Skip to content

Modules in Go

In Go, modules are a way to manage the dependencies of your Go projects. They allow you to define, version, and manage collections of Go packages, making it easier to build, share, and maintain code.

  • Initialise a golang project
go mod init github.com/hkirat/go-http-server
  • Fetch an external package
go get github.com/gin-gonic/gin
  • Use the external package
import "github.com/gin-gonic/gin"