• Stars
    star
    128
  • Rank 279,535 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created about 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A command to update globally installed go executables

go-global-update

go-global-update screenshot

Update globally installed go binaries.

The missing go command similar to npm -g update or cargo install-update.

Table of contents

Requirements

  • Go 1.16 or higher

Installation

go install github.com/Gelio/go-global-update@latest

Usage

Running

go-global-update

will print information about currently installed global binaries and attempt to upgrade those that have newer versions.

You can also do a dry run without update the binaries:

go-global-update --dry-run

or update just a handful of binaries:

go-global-update gofumpt

For more information, see

go-global-update --help

Upgrading go-global-update

go-global-update will take care of updating itself when it updates other binaries.

Troubleshooting

Do you have problems updating some binaries using go-global-update? Take a look at TROUBLESHOOTING.md for more information.

How it works

go-global-update consists of the following steps:

  1. Determine binaries to inspect.

    Either use the list of provided arguments or all executables installed in your go env GOBIN (or $(go env GOPATH)/bin).

  2. Inspect where each executable came from (by running go version -m [executable name] and checking the path),

  3. Check the latest version for each binary using go list -m -f "{{.Version}}" [path]

  4. If the binary has a newer version, run go install [package path]@latest to update it.

Alternative tools

go-global-update is not the only tool trying to solve the problem of updating globally-installed go binaries. The alternatives are:

  • gup

    Advantages:

    • includes desktop notifications
    • has a subcommand to remove a binary
    • has a way to export/import a list of binaries

    Disadvantages:

    • does not offer troubleshooting information when an upgrade fails
    • does not report error logs from failed updates
    • updates binaries installed from source (potentially overwrites locally-made changes)
  • binstale

    Disadvantages:

    • seems not to detect globally-installed binaries using go modules

      $ binstale
      binstale
           (no source package found)
      go-global-update
           stale: github.com/Gelio/go-global-update (stale dependency: github.com/Gelio/go-global-update/internal/colors)
      gofumpt
           (no source package found)
      gotop
           (no source package found)
      misspell
           (no source package found)
      shfmt

Contributing

Contributions are welcome! See CONTRIBUTING.md for more information.

More Repositories

1

tslint-react-hooks

TSLint rule for detecting invalid uses of React Hooks
TypeScript
217
star
2

cmp-natdat

nvim-cmp source to autocomplete natural dates and turm them into ISO dates
Lua
23
star
3

loose-ts-check

Run TS type-check and ignore certain errors in some files
TypeScript
18
star
4

tslint-import-group-ordering

TSLint rule for ordering import groups
TypeScript
17
star
5

ubuntu-dotfiles

Personal dotfiles and installation files for Ubuntu
Lua
7
star
6

aisd2-lab-tasks

Laboratory tasks for the AiSD 2 class at the MiNI Faculty at WUT
C#
4
star
7

mdx-deck-template

MDX deck template with some useful components
JavaScript
4
star
8

taio-graph-visualization

Graph visualization for a university project
TypeScript
4
star
9

bir-regon

Polish public company data query API
JavaScript
3
star
10

websocket-image-stream

Example websocket server and client
JavaScript
3
star
11

vscode-temporary-vim-motions

VSCode extension providing a popup for vim motions
TypeScript
3
star
12

next-intercept-ssr-navigation

Next app showcasing instant client-side navigation for pages with getServerSideProps
TypeScript
2
star
13

node-image-stream

Node server using socket.io to stream (possibly) images to users
JavaScript
2
star
14

js-testing-workshop

Workshop on Javascript & React testing
JavaScript
2
star
15

url-poller

Polls URL looking for updates and notifies upon them
JavaScript
2
star
16

p3-lab1617

College programming assignments (C++ and C#) (semester 2016/2017)
C#
2
star
17

wpf-image-browser

Image Browser created in WPF for the Windows Programming class
C#
2
star
18

the-project-game

Multi agent environment simulation
TypeScript
1
star
19

pixijs-spiral-transition

Slideshow transition using PixiJS
TypeScript
1
star
20

find-quadruples-with-product

A solution to an algorithmic challenge
Rust
1
star
21

polygon-clipper

TypeScript
1
star
22

react-native-todo-app

TODO app in React Native using Native Base
JavaScript
1
star
23

websocket-performance-demo

Demo of pushing lots of data via WebSocket
JavaScript
1
star
24

nvim-relative-date

Display relative dates as inline virtual text
Lua
1
star
25

CAL-web

A web modeler for CAL models
Java
1
star
26

doodle-parser

Parses Doodle polls and returns the results
TypeScript
1
star
27

react-hooks-workshop

Workshop on React Hooks
JavaScript
1
star
28

state-synchronizers

Deterministically update state based on other state
TypeScript
1
star
29

wedding-seater

Plan seating wedding guests at tables
TypeScript
1
star
30

distributed-computing-webworker-poc

Proof of concept presenting distributed computing using WebWorkers with C# code
WebAssembly
1
star