Versions in this module Expand all Collapse all v0 v0.1.1 Sep 9, 2026 Changes in this version + var ErrAnchorNotFound = errors.New("dotenv: anchor key not found") + func Read(path string, opts ...Option) (map[string]string, error) + type Capability string + const CapCommandRunner + const CapEntryObserver + const CapExpandObserver + const CapLookup + const CapSaveGuard + const CapValueTransformer + type CommandRunner interface + RunCommand func(cmd string) (string, error) + type Entry struct + Key string + Kind Kind + Raw []string + Value string + func NewBlank() *Entry + func NewComment(lines ...string) *Entry + func NewPair(key, value string) *Entry + type EntryObserver interface + ObserveEntry func(e *Entry) + type EscapeMode int + const EscapeCompose + const EscapeExtended + func (m EscapeMode) String() string + type ExpandObserver interface + ObserveExpand func(key, name, resolved string) + type File struct + Path string + func Open(path string, opts ...Option) (*File, error) + func Parse(content string, opts ...Option) *File + func ParseReader(r io.Reader, opts ...Option) (*File, error) + func (f *File) Append(entries ...*Entry) + func (f *File) Clone() *File + func (f *File) Count(key string) int + func (f *File) Disabled() []Pair + func (f *File) Entries() []*Entry + func (f *File) Existed() bool + func (f *File) ExpandedMap() (map[string]string, error) + func (f *File) Get(key string) (string, bool) + func (f *File) GetExpanded(key string) (string, bool, error) + func (f *File) Has(key string) bool + func (f *File) Inherited() []string + func (f *File) InsertAfter(anchorKey string, entries ...*Entry) error + func (f *File) InsertBefore(anchorKey string, entries ...*Entry) error + func (f *File) Keys() []string + func (f *File) Map() map[string]string + func (f *File) Mode() fs.FileMode + func (f *File) Pairs() []Pair + func (f *File) Plugins() []PluginInfo + func (f *File) Render() string + func (f *File) Restore(key string) bool + func (f *File) Save() error + func (f *File) SaveAs(path string) error + func (f *File) Set(key, value string) (created bool) + func (f *File) SetAfter(anchor, key, value string) (created bool, err error) + func (f *File) SetBefore(anchor, key, value string) (created bool, err error) + func (f *File) Unset(key string, del bool) (found bool) + type Kind int + const KindBlank + const KindComment + const KindDisabledPair + const KindInherited + const KindOther + const KindPair + func (k Kind) String() string + type Lookuper interface + Lookup func(name string) (value string, ok bool, err error) + type Option func(*options) + func WithCommandRunner(run func(string) (string, error)) Option + func WithCommandSubstitution(enabled bool) Option + func WithEscapes(m EscapeMode) Option + func WithLookup(fn func(name string) (string, bool)) Option + func WithPlugin(plugins ...Plugin) Option + func WithSaveGuard(fn func(*File) error) Option + func WithValueTransform(fn func(key, value string) (string, error)) Option + type Pair struct + Key string + Value string + type Plugin interface + Name func() string + type PluginInfo struct + Capabilities []Capability + Name string + func (p PluginInfo) String() string + type RequiredError struct + Empty bool + Key string + Message string + func (e *RequiredError) Error() string + type SaveGuard interface + GuardSave func(f *File) error + type ValueTransformer interface + TransformValue func(key, value string) (string, error) v0.1.0 Sep 6, 2026