Open danieljancar opened 8 months ago
I'll have a look into it, strange that the binary version behafes different... as fare as I know is go run
also compiled and executed...
Hey @rkruetli
I'll have a look into it, strange that the binary version behafes different... as fare as I know is
go run
also compiled and executed...
You're right, when running the built binary from the project's root, it works. Sadly, when moving the executable proxy-checker.exe
to another folder or executing it from a different path, it obviously can' find the config
or report
folder which is found at the project's root.
So either, running the binary from somewhere else isn't an option or we need to implement a workaround.
$ go build -o proxy-checker cmd/main.go
proxy-checker
from project root, since it got saved there
$ ./proxy-checker
2024/01/15 11:32:16 Requesting https://google.com
2024/01/15 11:32:16 Requesting https://dev.to
2024/01/15 11:32:16 Requesting https://css.ch
2024/01/15 11:32:16 Requesting https://slack.com
Fails when running the binary from different path then project root
$ ./go-proxy-request-checker/proxy-checker
2024/01/15 11:38:34 Error reading json file: open config/links.json: no such file or directory. Using default values...
2024/01/15 11:38:34 Requesting https://www.google.com
2024/01/15 11:38:34 Requesting https://www.slack.com
Check List
Description
When running the built binary of the program, it can't find the
links.json
because it's ran from a different path then the project root, also it can't export thereport.json
.Steps to Reproduce
Build executable binary from your local project, try to execute from terminal or GUI.
Expected Behavior
Should work as intended when running with
go run cmd/main.go
Actual Behavior
Throws error and fails reading/exporting files
Additional Info
-