Comments (2)
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...
from proxy-request-checker.
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.
Success
- Building a binary from project root
$ go build -o proxy-checker cmd/main.go
- Executing the
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
Fail
- 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
Solution
- Export the configs on build time into the binary, meaning they can't be changed afterwards.
- Make binary request a proper config file, from a constant path, before executing (environment_variables, etc.).
from proxy-request-checker.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxy-request-checker.