Giter Club home page Giter Club logo

Comments (7)

achille-roussel avatar achille-roussel commented on June 22, 2024

Would you be able to submit a patch?

Although there may be code that rely on the current behavior that would get broken by such a change.

Is your current workaround to copy the fields directly in the struct?

from conf.

abraithwaite avatar abraithwaite commented on June 22, 2024

My current workaround is just to live with a prefix. It's not a major issue right now and I don't plan on working on it anytime soon, but it's low hanging fruit for anyone who wants to take a shot.

from conf.

achille-roussel avatar achille-roussel commented on June 22, 2024

Cool.

I've been thinking about how to avoid those kinds of discrepancies. Currently we build an intermediary representation of the configuration in memory, which we then convert to the configuration struct type.

Instead of doing this we could serialize the configuration to JSON, then use the standard JSON decoder to load values into the configuration struct. This way there can be no behavior differences (this is the approach taken by packages like https://github.com/ghodss/yaml for example).

Food for thoughts!

from conf.

stevevls avatar stevevls commented on June 22, 2024

In order to avoid breaking compatibility, what do you guys think about using _ as the special tag to indicate that the embedded struct shouldn't be prefixed?

I'm thinking about taking a stab at this too (my particular use case is creating and embedding general Suppressor configuration to be shared between the Kafka and NSQ apps). Happy to brainstorm further because this would be a really cool feature.

from conf.

achille-roussel avatar achille-roussel commented on June 22, 2024

That sounds like a good idea to me 👍

from conf.

achille-roussel avatar achille-roussel commented on June 22, 2024

Doing it backward-compatible seems like a good first step, if you want to make it the default then we can tag a v1 release of the package, and introduce the change afterward.

from conf.

abraithwaite avatar abraithwaite commented on June 22, 2024

This was fixed in #23.

from conf.

Related Issues (11)

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.