How to upgrade Go module dependencies all at once ?

김영석
Jun 8, 2023

Go dependency management tips

  1. View a list of available upgrades for all dependencies of a given module by running
go list -m -u all

2. Run the following command at the project root directory

go get -u ./…

3. Tide up Go module to ensure the go.mod file matches the source code in the module.

go mod tidy

4. ( Optional ) To update vendoring directory

go mod vendor

Leave some comments if you would like to know anything else.

Thank you.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

김영석
김영석

Written by 김영석

I love problem solving and hate repetition of tedious tasks. I like automating, streamlining, optimizing, things.

No responses yet

Write a response