Comments (4)
The error is correct I would recommend to change the name of the field from URL
into something more specific. The error will be more helpful then.
from configor.
Ok, but it's anoying to have to use
config.InputService.InputServiceURL
instead of
config.InputService.URL
I planed to do a pull request for this issue but than I realized that even full name is not what I want.
InputService.URL is required, but blank
What I expect is more like
IN_SERVICE_URL variable is required, but blank
So I'm not using this lib anymore :) Not because it's bad.
But because anything simpler, for environment variables only, is enough for me.
from configor.
You are making assumptions based on the env
variable in the tag. Such variable might be also empty when this value is filled from other source than ENV variable.
Existing logic returns the name of the field which is required and its value is empty (not defined in any source).
Based on your code I would suggest naming the field: InputURL
or InURL
and same format for output to distinguish between them.
from configor.
Yeah, no doubt.
As I sayed, I don't use this lib anymore.
Less is more and it works for me.
I need to have the env vars only, following https://12factor.net/config, so I made a switch.
https://play.golang.org/p/ABZ7CuywNKQ
or good ol' os.Getenv and os.LookupEnv.
And instead of .env, yaml, toml, ... files you can use shell file for sourcing the dev environment.
And without adding the extra complexity to app.
$ . ./dev-env.sh
simple as pie
from configor.
Related Issues (20)
- found character that cannot start any token HOT 1
- Map type cause error "already set in map" with ErrorOnUnmatchedKeys, multiple YAML overlays
- Bug: when struct has pointer to other struct, processDefaults is not working
- []bytes tries to convert to []uint8
- Fail on load configuration should be propagated as error instead of just print it
- Cannot read the targetfile when I placed the config file in a subpakage and then run program with Environment argument
- doesn't support camel, or _ - split style field name in yml file HOT 2
- Missing LICENSE file
- Specify env var name in .yml file instead of go struct HOT 1
- configor.processDefaults(config) should notify on error HOT 1
- default not supported in slice and map HOT 1
- Support embedded directories
- Does it not support camel case naming
- Add support for loading into interface fields which have a *struct{} in them
- use fsnotify instead of polling for autoreload HOT 2
- Please create new tag HOT 1
- [bug] It's a Bug when Zero value equals to the value I set
- Env variable prefix
- data race happens randomly
- Counterintuitive handling of blank YAML properties with default values
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 configor.