Skip to content

Commit

Permalink
don't HEAD downloads now that we are filtering out precise versions
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAbides committed Jan 25, 2021
1 parent e56ce56 commit 6d9dd04
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 67 deletions.
28 changes: 0 additions & 28 deletions src/head-go-version

This file was deleted.

15 changes: 0 additions & 15 deletions src/resolve-go-version
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@ if [ -z "$IGNORE_LOCAL_GO" ]; then
done
fi

head_go_version="${head_go_version:-"./src/head-go-version"}"

# if the exact version is available to download, use it
if "$head_go_version" "$GO_VERSION_CONSTRAINT" ; then
echo "$GO_VERSION_CONSTRAINT"
exit
fi

## if the exact version is available to download, use it
#check_url="$(download_go_url "$GO_VERSION_CONSTRAINT")"
#if curl -IL --fail -s "$check_url" >/dev/null; then
# echo "$GO_VERSION_CONSTRAINT"
# exit
#fi

if [ -z "$IGNORE_LOCAL_GO" ]; then
set +e
local_matches="$(echo "$local_versions" | "$action_dir/third_party/sh-semver/semver.sh" -r "$GO_VERSION_CONSTRAINT")"
Expand Down
24 changes: 0 additions & 24 deletions src/resolve-go-version_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,13 @@ oneTimeSetUp() {
done
}

available_head_versions=''

mock_version_available_to_dl() {
v="$1"
for ver in $available_head_versions ; do
if [ "$ver" = "$v" ]; then
return 0
fi
done
return 1
}

mock_head_versions() {
export available_head_versions="$1"
export mock_head_go_version="1"
}

test_version() {
export dl_json="$ex_dl_json"
tmpdir="$SHUNIT_TMPDIR/${FUNCNAME[0]}"
toolcache="$tmpdir/go"
mkdir -p "$toolcache"
touch "$toolcache/1.14.2"
touch "$toolcache/1.15.6"
mock_head_versions '1.15
1.15beta1'

tests='*;1.15.6
1.15;1.15
Expand All @@ -81,18 +62,13 @@ tip;tip
done
}


test_version_ignore_local_go() {
export dl_json="$ex_dl_json"
tmpdir="$SHUNIT_TMPDIR/${FUNCNAME[0]}"
toolcache="$tmpdir/go"
mkdir -p "$toolcache"
touch "$toolcache/1.14.2"
touch "$toolcache/1.15.6"
mock_head_versions '1.15
1.15beta1'

export version_available_to_dl_func="mock_version_available_to_dl"

tests='*;1.15.7
1.15;1.15
Expand Down

0 comments on commit 6d9dd04

Please sign in to comment.