Giter Site home page Giter Site logo

Use dedicated dotenv library? about forego HOT 7 CLOSED

ddollar avatar ddollar commented on June 25, 2024
Use dedicated dotenv library?

from forego.

Comments (7)

subosito avatar subosito commented on June 25, 2024

👍 @joho. Would be great to see opensource projects collaborate to reduce duplication while increasing ability.

Just in case you don't know, I did also create similar project like yours, a port of dotenv, https://github.com/subosito/gotenv, which is also fully compatible with dotenv.

Would be great to see one of these ports to be merged into forego, let see @ddolllar response :).

By the way, what do you think is better, is it ok to keep two similar projects exists along with others or merge into a single project?

from forego.

ddollar avatar ddollar commented on June 25, 2024

Do either of these libraries let me load a .env file into a map rather than straight into os.Environ?

from forego.

joho avatar joho commented on June 25, 2024

Not at this stage, but I could add a godotenv.Read() that returns instead of doing os.Setenv on everything

On Wednesday, 4 September 2013 at 11:49 AM, David Dollar wrote:

Do either of these libraries let me load a .env file into a map rather than straight into os.Environ?


Reply to this email directly or view it on GitHub (#5 (comment)).

from forego.

ddollar avatar ddollar commented on June 25, 2024

I think that would be necessary to add it cleanly to forego. If you want to either create that Read method or even better submit a pull request to forego that would be awesome.

from forego.

subosito avatar subosito commented on June 25, 2024

Gotenv have support for that. You can using Parse() function. Here's the example:

// import "strings"

pairs := gotenv.Parse(strings.NewReader("FOO=test\nBAR=$FOO"))
// gotenv.Env{"FOO": "test", "BAR": "test"}

pairs = gotenv.Parse(strings.NewReader(`FOO="bar"`))
// gotenv.Env{"FOO": "bar"}

from forego.

ddollar avatar ddollar commented on June 25, 2024

@subosito Perfect, I switched forego to use gotenv. Thanks!

from forego.

subosito avatar subosito commented on June 25, 2024

You're welcome @ddollar 👍

from forego.

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.