Sometimes when I push too fast on one of dependencies, the Go proxy can't catch up the latest non-tagged commit on remote server. So, I need to get the latest module version on tip of git commit using the following shell script,
---- #!/bin/sh MODNAME=$(go list -m) DATE=$(date -u -r `git log -n 1 --date=local --pretty=format:'%ct'` +%Y%0m%0d%0H%0M%0S) HASH=$(git log -n 1 --pretty=format:'%h' --abbrev=12) TAG=$(git describe --abbrev=0 --tags 2>/dev/null) if [[ "${TAG}" == "" ]]; then TAG="v0.0.0" else IFS=. read MAJOR MINOR PATCH <<<"${TAG}" PATCH=$((PATCH+1)) TAG=${MAJOR}.${MINOR}.${PATCH} fi echo ${MODNAME} ${TAG}-${DATE}-${HASH} ---- and update the version on go.mod manually to force the proxy to get the defined version. I know that I should test and maybe use "replace" directive before committing any changes to one of dependencies, but one or two things sometimes slip out of our eyes. I have read the documentation on "go help list" and search the web for any alternatives, unfortunately I can't find one. If anyone have any idea about go command that can replace above script, that would be great. Regards, Shulhan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/949F7DDA-0FDC-424F-96B3-79EA49695726%40gmail.com.