Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to disable ASDF_GOLANG_MOD_VERSION_ENABLED #123

Open
MPV opened this issue Sep 11, 2023 · 3 comments
Open

Not able to disable ASDF_GOLANG_MOD_VERSION_ENABLED #123

MPV opened this issue Sep 11, 2023 · 3 comments

Comments

@MPV
Copy link

MPV commented Sep 11, 2023

Describe the bug
I have disabled ASDF_GOLANG_MOD_VERSION_ENABLED, but still getting the notice when starting my shell.

To Reproduce
Steps to reproduce the behavior:

  1. Add export ASDF_GOLANG_MOD_VERSION_ENABLED=false in the shell's configs (.zshrc/equivalent).
  2. Start a new shell.

Expected behavior
I should be able to disable the go.mod version detection (and just use .tool-versions for defining Golang version), without having my shell warning me about a feature I have decided to opt-out of.

Screenshots

Upon starting my shell:

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
$ env|grep ASDF_GOLANG_MOD_VERSION_ENABLED
ASDF_GOLANG_MOD_VERSION_ENABLED=false

Additional context

I'm using this version of the plugin:

$ asdf plugin list --refs | grep golang
golang                       master 3c3674a

i.e:

...which includes the change from:

i.e. this doesn't feel solved yet, in my mind:

Also, I think this other issue wouldn't be a bad idea:

@zackerydev
Copy link

@MPV make sure that line is the top of your .zshrc

I had mine below the asdf init and it wasn't working.

@crcastle
Copy link

I'm having a similar problem. Placing set ASDF_GOLANG_MOD_VERSION_ENABLED true above source (brew --prefix)/opt/asdf/libexec/asdf.fish in my (fish) shell configs stopped the warning message from appearing on every single prompt, but I continue to get the warning message any time I run go on the command line:

❯ go version
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
go version go1.20.13 darwin/arm64

~
❯ echo $ASDF_GOLANG_MOD_VERSION_ENABLED
true

~
❯  

Any ideas?

@crcastle
Copy link

Apologies for the last message, but I think I'll leave it in case someone runs into the same issue. Here's how I resolved it. Note that this only applies to the Fish shell.

Two options:

  1. Add set -gx ASDF_GOLANG_MOD_VERSION_ENABLED true to the top of /Users/crcastle/.config/fish/conf.d/asdf.fish. I mistakenly had left out the -gx when I wrote the comment above.
  2. Don't change any config files. Instead run set -Ux ASDF_GOLANG_MOD_VERSION_ENABLED true. This will save the env var persistently for any new shell (including after a restart).

I like option 1 better because it keeps asdf configuration in one place, the asdf.fish file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants