Skip to content

Instantly share code, notes, and snippets.

@wadey
Created March 20, 2019 01:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wadey/d008b6d3c5a2e4ddd9ca7b77f731f0b5 to your computer and use it in GitHub Desktop.
Save wadey/d008b6d3c5a2e4ddd9ca7b77f731f0b5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -u -e -o pipefail
go list -u -m -json all \
| jq -r 'if (.Indirect | not) and .Update then "\(.Path)\t\(.Version)\t\(.Update.Version)" else "" end' \
| sed -E 's/v[0-9]\.0\.0-[0-9]+-//g' \
| sed -E 's/golang.org\/x\//github.com\/golang\//g' \
| while read -r NAME A B
do
if [ -n "$NAME" ]
then
case "$NAME" in
github.com/*)
echo "https://$NAME/compare/$A...$B"
;;
*)
echo "$NAME - $A - $B"
;;
esac
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment