Coder Social home page Coder Social logo

Comments (4)

lukasaron avatar lukasaron commented on August 11, 2024

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.

prochac avatar prochac commented on August 11, 2024

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.

lukasaron avatar lukasaron commented on August 11, 2024

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.

prochac avatar prochac commented on August 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.