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

Goland Xgo shadow #244

Open
shubham-dogra-s1 opened this issue Jul 8, 2024 · 4 comments
Open

Goland Xgo shadow #244

shubham-dogra-s1 opened this issue Jul 8, 2024 · 4 comments

Comments

@shubham-dogra-s1
Copy link

shubham-dogra-s1 commented Jul 8, 2024

Hi, I am trying to use xgo with goland. Generated path using xgo shadow and prepended the path to PATH env variable for the test configuration but still goland using the default go installation.

/usr/local/go/bin/go tool test2json -t /Users/shubham.dogra/Library/Caches/JetBrains/GoLand2024.1/tmp/GoLand/___1TestHeathServer_1__http_request_error_in_internal_clients.test -test.v -test.paniconexit0 -test.run ^\QTestHeathCheckServer\E$/^\Q1:_http_request_error\E$
WARNING: xgo toolchain: failed to detect xgo version, consider install xgo: go install github.com/xhd2015/xgo/cmd/xgo@latest
note: this message can be turned off by setting XGO_CHECK_TOOLCHAIN_VERSION=false

I have verified that the first entry in path environment is the path generated by xgo shadow
PATH: /Users/shubham.dogra/.xgo/shadow:/usr/local/go/bin:/Users/shubham.dogra/go/bin

Am i missing something?

@shubham-dogra-s1
Copy link
Author

May be I am wrong but currently we only invoke xgo for [[ $cmd = build || $cmd = test || $cmd = run but if you see the command generated by goland it is using /usr/local/go/bin/go tool

@xhd2015
Copy link
Owner

xhd2015 commented Jul 8, 2024

It seems Goland always uses absolute path /usr/local/go/bin/go instead of go, which bypasses the shadow path.

For this scenario, I think xgo shadow needs to support absolute path replacement.

Let me test on my PC first.

@shubham-dogra-s1
Copy link
Author

hi @xhd2015 did you able to test this ?

@xhd2015
Copy link
Owner

xhd2015 commented Sep 8, 2024

It's difficult to make xgo work with goland correctly. Need to tinker another way.

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

No branches or pull requests

2 participants