DEV Community

Cover image for โ˜„๏ธ How to update version's cache of your package in
Vic Shรณstak
Vic Shรณstak

Posted on • Updated on

โ˜„๏ธ How to update version's cache of your package in


Hi, DEV people! ๐Ÿ˜‰ Sometimes, when you publish a new version of your Go package, may still give away an old version for a long time.

This also means, that if other people are using your package, not be able to update to the new version until the cache is updated.

Let's fix this! ๐Ÿ‘Œ

๐Ÿ“ Table of contents

A little story from real-life

That's what we did at Fiber Go web framework a few months ago.

GitHub logo gofiber / fiber

โšก๏ธ Express inspired web framework written in Go

After fixed a major bug, a new Fiber version could not be installed on users projects for about a couple of hours, because the cache was not updated. But the press release for the fix was already out (in official repository, Twitter, etc.) and users wanted to update and could not.

Worst-case scenario, isn't it? ๐Ÿ˜จ

โ†‘ Table of contents


Save this command to a Makefile (or a task manager you're using now):

# ...

    go get$(USER)/$(PACKAGE)@v$(VERSION)

# ...
Enter fullscreen mode Exit fullscreen mode

And use it, like this:

make update-pkg-cache USER=gofiber PACKAGE=fiber VERSION=1.12.4
Enter fullscreen mode Exit fullscreen mode


  • USER your GitHub user or organization name
  • PACKAGE a name of your package to update cache
  • VERSION a version number to update cache

It's that simple and clear!

โ†‘ Table of contents


If you want more articles like this on this blog, then post a comment below and subscribe to me. Thanks! ๐Ÿ˜˜

And, of course, you can support me by donating at LiberaPay. Each donation will be used to write new articles and develop non-profit open-source projects for the community.

Support author at LiberaPay

Top comments (1)

sudden_dev profile image
Andrey Slotin

Hey Vic, nice write up. I've had the same problem earlier this year and came up with a Github Action that does pretty much the same every time a new package version is released: