ref!(go): separate go from go-essentials for 1.21

This commit is contained in:
AJ ONeal
2023-08-09 22:57:38 +00:00
parent 80dace64f3
commit 98d2cd3af0
4 changed files with 69 additions and 58 deletions
-28
View File
@@ -17,15 +17,6 @@ if (!(Get-Command "git.exe" -ErrorAction SilentlyContinue))
$Env:PATH = "$Env:USERPROFILE\.local\opt\git\cmd;$Env:PATH"
}
Write-Host '' -ForegroundColor red -BackgroundColor white
Write-Host '*********************' -ForegroundColor red -BackgroundColor white
Write-Host '* BREAKING CHANGE *' -ForegroundColor red -BackgroundColor white
Write-Host '*********************' -ForegroundColor red -BackgroundColor white
Write-Host '' -ForegroundColor red -BackgroundColor white
Write-Host ' ''webi golang'' will NOT install go tooling starting with go1.21+' -ForegroundColor red -BackgroundColor white
Write-Host ' use ''webi go-essentials'' to preserve the previous behavior' -ForegroundColor red -BackgroundColor white
Write-Host '' -ForegroundColor red -BackgroundColor white
# Fetch archive
IF (!(Test-Path -Path "$pkg_download"))
{
@@ -65,25 +56,6 @@ Remove-Item -Path "$pkg_dst" -Recurse -ErrorAction Ignore
Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
IF (!(Test-Path -Path go\bin)) { New-Item -Path go\bin -ItemType Directory -Force | out-null }
# Special to go: re-run all go tooling builds
echo "Building go language tools..."
echo gopls
& "$pkg_dst_cmd" install golang.org/x/tools/gopls
echo golint
& "$pkg_dst_cmd" install golang.org/x/lint/golint
echo errcheck
& "$pkg_dst_cmd" install github.com/kisielk/errcheck
echo gotags
& "$pkg_dst_cmd" install github.com/jstemmer/gotags
echo goimports
& "$pkg_dst_cmd" install golang.org/x/tools/cmd/goimports
echo gorename
& "$pkg_dst_cmd" install golang.org/x/tools/cmd/gorename
echo gotype
& "$pkg_dst_cmd" install golang.org/x/tools/cmd/gotype
echo stringer
& "$pkg_dst_cmd" install golang.org/x/tools/cmd/stringer
# Add to path
webi_path_add ~/.local/opt/go/bin
-23
View File
@@ -15,19 +15,6 @@ pkg_cmd_name="go"
#
# Their defaults are defined in _webi/template.sh at https://github.com/webinstall/packages
if [ -z "${WEBI__GO_ESSENTIALS-}" ]; then
# TODO nix for go1.21+
echo >&2 ""
printf >&2 '\e[31m%s:\e[0m\n' '#####################'
printf >&2 '\e[31m%s:\e[0m\n' '# BREAKING CHANGE #'
printf >&2 '\e[31m%s:\e[0m\n' '#####################'
echo >&2 ""
printf >&2 "\e[31m 'webi golang' will NOT install go tooling starting with go1.21+\e[0m\n"
printf >&2 "\e[31m use 'webi go-essentials' to preserve the previous behavior\e[0m\n"
echo >&2 ""
sleep 4
fi
pkg_get_current_version() {
# 'go version' has output in this format:
# go version go1.14.2 darwin/amd64
@@ -68,18 +55,8 @@ pkg_post_install() {
# "$HOME/.local/opt/go"
webi_path_add "$pkg_dst_bin"
webi_path_add "$GOBIN/bin"
if [ -z "${WEBI__GO_ESSENTIALS-}" ]; then
# TODO nix for go1.21+
WEBI__GO_INSTALL='true'
export WEBI__GO_INSTALL
"$HOME/.local/bin/webi" "go-essentials@${WEBI_TAG}"
fi
}
pkg_done_message() {
echo "Installed 'go v$WEBI_VERSION' to ~/.local/opt/go"
# note: literal $HOME on purpose
#shellcheck disable=SC2016
echo 'Installed go "x" tools to GOBIN=$HOME/go/bin'
}