Skip to content

env

A high-security Go environment variable management library supporting .env, JSON, and YAML formats, with thread safety, audit logging, and secure storage.

Core Features

  • Multi-format support - .env, JSON, YAML auto-detection
  • Type safety - automatic type conversion and validation
  • Thread safety - concurrent access with sharded locks
  • Secure storage - memory locking and auto-zeroing for sensitive values
  • Audit logging - complete operation tracking
  • Variable expansion - ${VAR} syntax support
  • Struct mapping - tag-driven configuration binding

Not sure where to start? Choose by your need:

I want to...Where to look
Get started in 5 minutesQuick Start
Store passwords and keys securelySecurity OverviewSecureValue
Prevent sensitive data from being swapped to diskMemory Locking
Safely handle sensitive data in logsData Masking
Map environment variables to a structStruct Mapping
Load JSON/YAML config filesMulti-format Config
Configure variable references and reuseVariable Expansion
Serialize/export configurationSerialization
Record security audit logsAudit Logging
Handle and match errorsError Handling
Write unit testsTesting
Extend with custom file formatsCustom Parser
Security checks before going liveProduction Checklist
See common code snippetsCheat Sheet
Find answers to common questionsFAQ

Key Features Overview

FeatureDescription
Type ConversionGetString, GetInt, GetBool, GetDuration, GetSlice
Struct MappingTag-driven configuration binding
Secure StorageMemory protection for sensitive values
Multi-format Loading.env, JSON, YAML

Quick Navigation

Getting Started

API Reference

Security