-
Notifications
You must be signed in to change notification settings - Fork 171
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
Makefile (golang make) throw an error with multi path in go env #896
Comments
Hi @cyb0225, |
/kind easy |
/cc @seeflood |
@seeflood Of coures. |
However, I am not sure if you have similar issues when running |
There's no rule for |
OK,I will update the docs as well. |
I think you just need to add goimport in your PATH. |
I have already add goimport in my PATH. I can call it directly. cyb@DESKTOP-6AOA5PJ:~/project/ospp/layotto$ go env GOPATH
/home/cyb/go:/mnt/e/env/gopath
cyb@DESKTOP-6AOA5PJ:~/project/ospp/layotto$ /home/cyb/go/bin/goimports -w -local mosn.io/layotto .
cyb@DESKTOP-6AOA5PJ:~/project/ospp/layotto$ goimports -w -local mosn.io/layotto . And in the go.mk, it uses |
@seeflood I'm sorry to bother you again. I found that |
@cyb0225 You can use |
I see, thank you very mach ! |
Hey @cyb0225, thanks for raising a PR, things look good to me! Thanks for your contribution : ) |
/area tools |
/close Thanks! @cyb0225. I wrote the robot to manage our issues and PRs. These are the commands it provided https://github.com/mosn/layotto/blob/main/.github/workflows/kube-bot.yaml#L34. Different roles have different privileges to use cmds. Hope you can grow in the community and have more priviledges to ask the bot to do more things : ) Current cmds you can use:
Have fun : ) |
Thanks! Good useful tools ! |
What happened:
When I tried to follow this documentation, some of commands do not work well in my computer.
When I use
make format
, I got the following error logs.And I found the source code in Makefile.
I have noticed that the problem is probably caused by the direct use of the full path of go env in the Makefile.
So I manually executed the commands in the Makefile and found that they can run successfully.
What you expected to happen:
Why I have more than one golang env path?
One is the installation of Golang on WSL that I set up in the configuration file, and the other is the path of Goland, which is for using the version control of Goland conveniently on WSL.
Therefore, I think it is necessary to consider multiple path scenarios in the Makefile since go env already supports it by default.
How to reproduce it (as minimally and precisely as possible):
I think we may choose the first one to avoid this problem.
Here is my sulotion.
cyb@DESKTOP-6AOA5PJ:~/project/ospp/layotto$ go env GOPATH | cut -d ':' -f 1 /home/cyb/go
So the source code should be change into the following one.
layotto/make/golang.mk
Line 31 in 7abad2f
I modified the Makefile without authorization and tested it with "make format", which passed the test successfully.
Anything else we need to know?:
I think that Is it true that the docs documentation is not consistent with the Layotto Makefile version.
I can not found the command of
make check
and ``inmake help
, and I got the following logs when I use it.I am not entirely sure if make all is a built-in command in Makefile. When I tried to use it, I also encountered the issue of the target not existing, but I can still use the make command normally.
If you also approve of this solution or have another ideas, I would be happy to take on the bug fix and update the documentation.
I sincerely wish for the continuous development of Layotto.
The text was updated successfully, but these errors were encountered: