Commit Graph

57 Commits

Author SHA1 Message Date
Riccardo Padovani
159af6218b
Update list-bin-paths to include bin (#146)
Fix #143
2024-09-24 21:00:20 -04:00
Russell Sanborn
116667e7ce
Update asdf-golang links to reference asdf-community instead of kennyp (#124) 2023-09-26 12:52:15 -04:00
Sora Morimoto
d8dec15ccc
Hygiene (#113)
* Add Makefile for Hygiene

Signed-off-by: Sora Morimoto <sora@morimoto.io>

* make format

Signed-off-by: Sora Morimoto <sora@morimoto.io>

---------

Signed-off-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: Kenny Parnell <k.parnell@gmail.com>
2023-07-19 09:32:53 -04:00
Kenny Parnell
3c3674a10c
Add support for ASDF_GOLANG_MOD_VERSION (#101)
* Emmit warning and change behavior based on ASDF_GOLANG_MOD_VERSION

* Add note on ASDF_GOLANG_MOD_VERSION to README.

* Rename to ASDF_GOLANG_MOD_VERSION_ENABLED.
2023-05-11 14:37:45 -04:00
whi-tw
b0a0ee7d85
Use go.work in the same way as go.sum (#100)
Go workspaces were introduced in Go 1.18:
https://go.dev/blog/get-familiar-with-workspaces

They list a go version, so we can use them in the same way as go.mod
2023-05-09 10:56:42 -04:00
Windymelt
be7daa8c57
avoid using stdin and use fd (#87)
Closes #90
2023-05-09 10:34:48 -04:00
Kenny Parnell
f006a12d6e
Add ASDF_GOLANG_SKIP_CHECKSUM to skip verifying checksum. (#95)
Update README
2022-12-17 00:10:23 -05:00
Kenny Parnell
c38b6d3ed2
Don't call back into asdf list golang (#93) 2022-12-16 23:43:41 -05:00
Kenny Parnell
1c2311264e
Revert "fix: replace google with go url (#88)" (#94)
This reverts commit ae1c810a85.
2022-12-16 23:34:04 -05:00
Julien Bongars
ae1c810a85
fix: replace google with go url (#88)
Co-authored-by: julien <julien@undercurrent.tech>
2022-12-16 23:32:12 -05:00
Eric Miller
cc8bc47d48
Filter latest version on user input (#74)
Fixes issue #73
2022-03-07 09:35:25 -05:00
Jesús Miguel Benito Calzada
353cca617b
Make exec-env strict-mode compliant (#72)
This file is not bash strict-mode compliant and because of that, if you execute it from a script in strict mode, it will through an error like follows:

WARN Failed to discover go env: failed to run 'go env': exit status 1
ERRO Running error: context loading failed: failed to load packages: failed to load with go/packages: err: exit status 1: stderr: /Users/myuser/.asdf/plugins/golang/bin/exec-env: line 4: GOROOT: unbound variable
2022-02-28 14:57:22 -05:00
Kenny Parnell
71424d8ed1
actually add new latest-stable script 2022-02-09 15:14:59 -05:00
Kenny Parnell
2dad3faf58
Make sure latest is actually available. 2022-02-09 15:12:28 -05:00
Kenny Parnell
03d30a52ae
Append @latest if doing install and version isn't specified. 2022-02-09 14:30:28 -05:00
John Maguire
89ced07d86
Updated the default packages command to use "go install" for versions 1.16+ (#67)
* Updated the default packages command to use "go install" for versions
greater than 1.16

* Cleaning up for linting, added condition to also check major version

* Update Version Parsing

Attempts to make shell check happy.

Co-authored-by: john.maguire <john.maguire@cbinsights.com>
Co-authored-by: Kenny Parnell <k.parnell@gmail.com>
2022-02-09 14:18:21 -05:00
Kenny Parnell
09f1801f10
Speed Up list-all/latest (#63)
* Switch to git ls-remote instead of parsing bucket.

* Update README to point to Travis.com
2021-11-16 09:58:02 -05:00
Michael Poutre
85dab2f4f2
Add ASDF_GOLANG_OVERWRITE_ARCH override option (#62)
* Add ASDF_GOLANG_OVERWRITE_ARCH override option

This change adds an ASDF_GOLANG_OVERWRITE_ARCH variable to allow overriding the architecture. This is useful if you need to install version of Go that were not released for macOS ARM. This is also done in the asdf terraform plugin: e1c7eea0f7/bin/install (L115-L129)

* Update README to include section about ASDF_GOLANG_OVERWRITE_ARCH
2021-10-28 17:03:53 -04:00
William Poetra Yoga
4f8976deb0
Prevent double-downloading installation archive (#61)
This small change prevents `asdf` from downloading the installation archive twice. This reverts a line change from #54.

Side note: according to https://asdf-vm.com/plugins/create.html, `bin/download` should do the downloading, not `bin/install`.
2021-10-20 13:12:58 -04:00
Jake Romer
337e60ef60
Check env var for default package list (#59)
Source the default package list from the env var `$ASDF_GOLANG_DEFAULT_PACKAGES_FILE`, defaulting to `${HOME}/.default-golang-pks` if the former is not set.
2021-08-25 20:37:15 -04:00
Kenny Parnell
92a2e61081 Cleanup ShellCheck warnings. 2021-06-16 10:46:00 -04:00
LouDou
cb8678e87e
Fix the install script (#54)
- Allows ASDF_DOWNLOAD_PATH to be unset or empty
- Ensure the download actually happens
- Clean up temp dir after download and installation
2021-06-16 10:33:28 -04:00
Craig Furman
bc51a8097f
Use highest matching minor version from go.mod (#50)
The go directive in go.mod files is of the format `major.minor`. This
commit will allow the highest installed version of go with the same
major component to be selected. The previous behaviour was to use the
highest installed version with the same major _and_ minor components,
but I don't think this was strictly necessary. It is valid to use go
1.16 to build a project whose go.mod declares "go 1.14", for example.
For packages within the module, the compiler should reject use of
language features introduced after the version specified by the go
directive.

I think this adheres more closely to the expected behaviour of programs
that parse `go.mod`, and asdf users who need to pin a particular minor
or patch version of go can use `.tool-versions` or `.go-version`.

Source: https://golang.org/ref/mod#go-mod-file-go
2021-06-16 08:04:20 -04:00
w1mvy
36f12c9393
Exit when download status 404 or 403 (#55) 2021-06-15 20:42:59 -04:00
Samuel García
625e8a23ce
Add extra space between sha256sum args (#52) 2021-06-15 17:09:39 -04:00
Alex Rudd
1f388f1b6a
Add extra space between shasum args (#49) 2021-05-12 13:46:48 -04:00
Kenny Parnell
9480360cc6
Add help texts per plugin guidelins. (#46) 2021-01-04 19:19:48 -05:00
Kenny Parnell
b1990b0a23
Add bin/download per latest asdf guidelines (#45)
- Creates a temporary directory if using an older version of asdf.
- Install delegates to bin/download if using an older version of asdf.
2021-01-04 17:36:54 -05:00
BeanNan
3950f3633c
add check_shasum (#44)
* add check_sum

* Update README

* fix typo
2021-01-04 13:18:00 -05:00
Tomoyuki Harada
ab7c352e73
Set default GOPATH and GOROOT when installing default go pkgs (#43)
* set `GOROOT` and `GOPATH` in install_default_go_pkgs()

* quote paths

* pass GOROOT and GOPATH to the go command when installing default
packages

* remove unnecessary variable
2021-01-04 13:16:46 -05:00
Tomoyuki Harada
590a00cd20
fix: invalid asdf path in install_default_golang_pkgs() (#40)
* fix: invalid asdf path in `install_default_golang_pkgs()`

* no need to perform reshim in plugin's install

reshim should be performed in asdf when plugin's `bin/install` returns 0
2021-01-01 19:09:06 -05:00
Jerred Shepherd
958693df90
Support M1 ARM chip (#42)
Fix error `Arch 'arm64' not supported!` during install on M1 ARM chip
2020-12-08 13:47:15 -05:00
Tomoyuki Harada
aaf9769563
fixes #38 (#39)
* fixes #38

* quote paths
2020-12-08 13:38:53 -05:00
David Marcin
ddffda95d5
Fix PATH for new go install (#41) 2020-12-08 13:35:19 -05:00
Michael Hale
9297fbefb1
Find the most recent matching installed version (#34)
* Find the most recent matching installed version

* pin match to beginning of string
2020-07-13 16:30:56 -04:00
Jack McCown
44abfc842f
feat: support auto go get default packages (#30) 2020-06-16 18:11:29 -04:00
Michael Hale
b7780500cf
Extract version from go.mod files (#32)
* Extract version from go.mod files

* make it work on linux too

* whitespace

* ignore asdf testing checkout

* fix test
2020-06-16 18:08:17 -04:00
uzxmx
831b8db058
Switch to dl.google.com
* Update default url when installing

Signed-off-by: Mingxiang Xue <mingxiangxue@gmail.com>

* Cleanup unneeded BASE_URL

Signed-off-by: Mingxiang Xue <mingxiangxue@gmail.com>
2020-05-11 23:14:25 -04:00
Trung Lê
b93b58b69e Support ppc64le architecture (#26)
* Support ppc64le version of Go

* Mention about ppc64le architecture in the README

* Test multi-arch on Travis CI

* Use commit SHA for plugin-gitref
2020-01-27 17:41:36 -05:00
Matthew Eddey
c6f1673d78 Support aarch64 (arm64) 2019-08-23 08:17:07 -07:00
Adrian Wilkins
323efb2645 Removed redundant script 2019-07-16 14:15:27 +01:00
Adrian Wilkins
7345694413 Allow use of legacy filenames 2019-04-04 16:32:32 +01:00
Wladimir Braguini Domingues
b49f236f7f Sort versions so newest version be listed last
The list-all command shows golang versions in the wrong order:
version 1.10 is listed before 1.2 and should be after 1.9 so it
appears closer to the user's prompt
2018-06-26 19:37:04 -03:00
Mrinal Wadhwa
154fd2adba fix temp directory creation for osx 2018-01-23 20:17:04 -06:00
Kenny Parnell
68875a227b Make BSD sed play nice.
Merges #12

Squashed commit of the following:

commit 29d691dfe0
Author: Kenny Parnell <k.parnell@gmail.com>
Date:   Mon Jan 22 21:31:59 2018 -0500

    Use the current branch instead of master for Travis

commit 708bd0f74a
Author: Kenny Parnell <k.parnell@gmail.com>
Date:   Mon Jan 22 21:27:28 2018 -0500

    Try to determine which sed we're using.
2018-01-22 21:48:35 -05:00
Kenny Parnell
53f76cffe1
Merge pull request #11 from barnabasJ/patch-1
Update list-bin-paths
2018-01-22 11:03:07 -05:00
Kenny Parnell
ceb54998d2 Incorporate changes from @vifino to support armv{6,7}l/Alpine Linux.
Closes #3
2018-01-22 11:00:40 -05:00
Kenny Parnell
01994416c6 Add support for FreeBSD 2018-01-22 10:43:32 -05:00
Kenny Parnell
d34f9282b4 Only set pipefail if Bash 3 or greater. 2018-01-22 09:45:18 -05:00
Barnabas Jovanovics
b8dd39acbf
Update list-bin-paths
added packages/bin, so that reshim will pick up on the installed packages
2018-01-05 15:44:13 +01:00