784 B
784 B
Correct Way to Run the Go Server
The error occurs because you are running go run .\main.go.
In Go, go run file.go only compiles that specific file. However, your main package is now split across multiple files:
main.go(Main entry point)handlers_runner.go(ContainsrunCode)handlers_rbac.go(ContainsadminGetPermissions,adminUpdateRolePermissions)
When you run only main.go, the compiler cannot see the functions defined in the other files, causing "undefined" errors.
Solution
Please run the following command in the server directory instead:
go run .
This command tells Go to compile all files in the current package directory, which will successfully link runCode, adminGetPermissions, and other functions.