GoLang - Managing Dependencies

Table of Contents

GoLang - Managing Dependencies

Managing dependencies: https://go.dev/doc/modules/managing-dependencies

How to determine which version of go is installed and set in the path?

which go
go env GOROOT

If I have golang 1.24 installed and set in the path, how do I use 1.23 for one specific application?

  1. Install thhe Go 1.23 toolchain

    go get toolchain@go1.23.0
    
  2. Configure that specific application to use Go 1.23

    cd /path/to/that/project
    go mod edit -go=1.23
    
  3. Run this to clean up the module file and ensure everything is consistent.

    go mod tidy
    

Links to this note