Permission Denied Error in Makefile When Running Go
You may encounter "permission denied" errors while running Go commands through a Makefile, even when you can execute them directly. This discrepancy arises due to an issue in GNU make.
Cause:
The error occurs when you have a directory on your PATH that contains a subdirectory named "go." For instance, if you have "/usr/bin/go/" on your PATH, it could interfere with the execution.
Solution:
To address this issue, check your PATH variable and remove any directories containing subdirectories named "go." If that's not feasible, add a semicolon (";") after the "go run" command in your Makefile to force GNU make to use a shell.
Example:
run: go run . ;
Additional Insights:
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3