File tree Expand file tree Collapse file tree 2 files changed +22
-11
lines changed
Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,18 @@ To install the previous minor release of Go:
8282gimme oldstable
8383```
8484
85- To install the most recent patch of the release specified in the ` go.mod ` file:
85+ To install the release specified in the ` go.mod ` file:
8686
8787``` bash
8888gimme module
8989```
9090
91+ If the ` go ` directive in the go.mod is in the form ` go 1.21 ` ,
92+ ` gimme module ` will install the latest patch version, e.g. ` 1.21.5 ` .
93+ However, if the ` go ` directive in go.mod is in the form ` go 1.21.3 ` ,
94+ ` gimme module ` will install the exact version, ` 1.21.3 ` .
95+ Note that the latter form is supported only by Go 1.21 or later.
96+
9197Or to install and use the development version (master branch) of Go:
9298
9399``` bash
Original file line number Diff line number Diff line change @@ -904,13 +904,26 @@ if [[ -n "${2}" ]]; then
904904 GIMME_VERSION_PREFIX=" ${2} "
905905fi
906906
907+ case " ${GIMME_GO_VERSION} " in
908+ stable) GIMME_GO_VERSION=$( _get_curr_stable) ;;
909+ oldstable) GIMME_GO_VERSION=$( _get_old_stable) ;;
910+ module) GIMME_GO_VERSION=$( _resolve_version module) ;;
911+ esac
912+
913+ _assert_version_given " $@ "
914+
907915case " ${GIMME_ARCH} " in
908916x86_64) GIMME_ARCH=amd64 ;;
909917x86) GIMME_ARCH=386 ;;
910918arm64)
911- if [[ " ${GIMME_GO_VERSION} " != master && " $( _versint " ${GIMME_GO_VERSION} " ) " < " $( _versint 1.5) " ]]; then
919+ min_arm64_version=1.5
920+ if [[ " ${GIMME_HOSTOS} " == ' darwin' ]]; then
921+ min_arm64_version=1.16
922+ fi
923+
924+ if [[ " ${GIMME_GO_VERSION} " != master && " $( _versint " ${GIMME_GO_VERSION} " ) " < " $( _versint " $min_arm64_version " ) " ]]; then
912925 echo >&2 " error: ${GIMME_ARCH} is not supported by this go version"
913- echo >&2 " try go1.5 or newer"
926+ echo >&2 " try go ${min_arm64_version} or newer"
914927 exit 1
915928 fi
916929 if [[ " ${GIMME_HOSTOS} " == " linux" && " ${GIMME_HOSTARCH} " != " ${GIMME_ARCH} " ]]; then
@@ -927,14 +940,6 @@ arm64) ;;
927940arm* ) GIMME_HOSTARCH=arm ;;
928941esac
929942
930- case " ${GIMME_GO_VERSION} " in
931- stable) GIMME_GO_VERSION=$( _get_curr_stable) ;;
932- oldstable) GIMME_GO_VERSION=$( _get_old_stable) ;;
933- module) GIMME_GO_VERSION=$( _resolve_version module) ;;
934- esac
935-
936- _assert_version_given " $@ "
937-
938943(( force_install)) && _wipe_version " ${GIMME_GO_VERSION} "
939944
940945unset GOARCH
You can’t perform that action at this time.
0 commit comments