Skip to content

Instantly share code, notes, and snippets.

View gnsalok's full-sized avatar
🎯
Focusing

Alok Tripathi gnsalok

🎯
Focusing
View GitHub Profile
@gnsalok
gnsalok / go_dependency_management.txt
Created March 31, 2023 13:23
Dependency management in Go
// Initialise the module
$ go mod init <module_name> // ex : github.com/gnsalok/ps-go
// If you import any package, you can run the below command to get modules, and it will add a module under the go.mod file
$go mod tidy
// To verify why other dependencies are in the go.sum file.
$ go mod why -m <module_name> // ex : github.com/gorilla/websocket
// Get a specific version of a package