Go-lang ep-4
About : In this blog we will see about all about *“*go.mod” file. We will see open source examples and projects to understand the best practice and way of writing production-grade backend code. here we gonna use a open project named Fider →(writte...

About :
In this blog we will see about all about *“*go.mod” file.
We will see open source examples and projects to understand the best practice and way of writing production-grade backend code.
here we gonna use a open project named Fider →(written in go). We gonna take the examples and best practice from now on. So for this blog it’s best if you download the source code in your favourite IDE. the reason is we gonna use some reference of this open source code base.
Pre-requisite :
What is go.mod?
Basic Structure of Go-Mod file →
module github.com/ayushbasak101/go-show go 1.23.4 require ( github.com/gin-gonic/gin v1.10.0 golang.org/x/crypto v0.22.0 )Explanation →
module → The name of your module (usually a repo path, but can be anything).
go → minimum version of go is supported.
require → list all the dependency required for running the project.
Open source reference :
In codebase you can see there are same structure in fider’s code base too.

Use of mod file :
Minimum version of GO : The mod file tell us the minimum version of the GO that is needed for running the code .
Management of Dependency : In the mod file all the required package that will be used in the code to make it functional will be there.
Installing the new Dependency: To install any new dependency w