mirror of
https://github.com/kennyp/asdf-golang.git
synced 2024-10-06 04:32:07 +08:00
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.
This commit is contained in:
parent
b0a0ee7d85
commit
3c3674a10c
@ -61,6 +61,10 @@ version with a matching major version. For example, a `go 1.14` directive in a
|
|||||||
`go.mod` file will result in the highest installed `1.minor.patch` being
|
`go.mod` file will result in the highest installed `1.minor.patch` being
|
||||||
selected, not necessarily `1.14.patch`.
|
selected, not necessarily `1.14.patch`.
|
||||||
|
|
||||||
|
**Note**: Users can explicitly exclude or include `go.mod` and `go.work` by
|
||||||
|
setting `ASDF_GOLANG_MOD_VERSION_ENABLED`. Currently it defaults to `true`, but that
|
||||||
|
may change in the future, so it should be explicitly set.
|
||||||
|
|
||||||
## Architecture Override
|
## Architecture Override
|
||||||
|
|
||||||
The `ASDF_GOLANG_OVERWRITE_ARCH` variable can be used to override the architecture
|
The `ASDF_GOLANG_OVERWRITE_ARCH` variable can be used to override the architecture
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo ".go-version go.mod go.work"
|
case "${ASDF_GOLANG_MOD_VERSION_ENABLED:-}" in
|
||||||
|
true)
|
||||||
|
printf ".go-version go.mod go.work\n"
|
||||||
|
;;
|
||||||
|
false)
|
||||||
|
printf ".go-version\n"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cat >&2 <<-EOF
|
||||||
|
Notice: Behaving like ASDF_GOLANG_MOD_VERSION_ENABLED=true
|
||||||
|
In the future this will have to be set to continue
|
||||||
|
reading from the go.mod and go.work files
|
||||||
|
EOF
|
||||||
|
printf ".go-version go.mod go.work\n"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user