Home >Backend Development >Golang >Why Does Makefile Throw a Permission Denied Error for Go Commands?
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:
The above is the detailed content of Why Does Makefile Throw a Permission Denied Error for Go Commands?. For more information, please follow other related articles on the PHP Chinese website!