Skip to content

Instantly share code, notes, and snippets.

@brndnsmth
Last active March 9, 2024 15:01
Show Gist options
  • Save brndnsmth/e0bb8eaaa13272694d0846637229c4f0 to your computer and use it in GitHub Desktop.
Save brndnsmth/e0bb8eaaa13272694d0846637229c4f0 to your computer and use it in GitHub Desktop.
go commands
// Usual process
mkdir project-name
cd project-name
git mod init github.com/brndnsmth/project-name
go get -u gorm.io/gorm // example install
go get -u gorm.io/driver/sqlite // example install
go mod tidy
go run main.go
// Set install directory for all go modules
// Keeps home directory clean by using hidden file
go env -w GOPATH=$HOME/.go
// List all versions of a module
go list -m -versions gorm.io/gorm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment