env
Package env provides process.env and dotenv-style configuration loading.
import "github.com/sahilkhaire/gox/env"
Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.
Functions
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| Get | process.env.KEY | func | Get returns the value for key (override, then os.Getenv). |
| GetBool | — | func | GetBool parses a bool environment variable. |
| GetDuration | — | func | GetDuration parses a duration environment variable. |
| GetInt | — | func | GetInt parses an int environment variable. |
| Load | require('dotenv').config() | func | Load parses a dotenv file and sets variables in the environment and override layer. |
| MustGet | — | func | MustGet returns the value or panics if missing. |
| Set | — | func | Set sets an override value (for tests). |