Git Product home page Git Product logo

Comments (3)

luisdavim avatar luisdavim commented on June 15, 2024 2

@runeimp I'm not sure what you mean by a reset, would this be a function to read an env file and unset any vars defined in it? You can implement this on your side with something like:

env, _ := gotenv.Read(".env")
// do stuff with env and then reset....
for var := range env {
	os.Unsetenv(var)
}

The library itself doesn't keep track of the variables it was used for setting, you can also use os.Clearenv() to unset all the env vars within your program, but that could have some side effects, like for example, it would also unset $PATH....

@autocorrectoff yes, check the fixtures folder for some examples, but that question seems unrelated to the original issue...

from gotenv.

runeimp avatar runeimp commented on June 15, 2024

BTW, I'd also be happy to send a Pull Request if you would like me to take a crack at it for you. 😀

from gotenv.

autocorrectoff avatar autocorrectoff commented on June 15, 2024

@subosito Can we put comments in the .env file?

from gotenv.

Related Issues (13)

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.