Documentation
¶
Overview ¶
Package dotenv provides a line-preserving scanner and emitter for dotenv files. Unlike map-based parsers, it retains original bytes, ordering, comments, blank lines, and line terminators so that unmodified lines pass through byte-for-byte and only resolved values are rewritten.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Line ¶
type Line struct {
Raw string // exact original bytes of the line, WITHOUT the line terminator
Ending string // the terminator that followed Raw: "\n", "\r\n", or "" (last line without a trailing newline)
Kind LineKind
Key string // set only for KindKeyVal
Value string // raw value substring for KindKeyVal (may contain '='), as it appeared in the source
Resolved bool // false from Scan; the render pipeline sets true after replacing Value with a resolved secret
}
Line is one physical line of a dotenv file.
type LineKind ¶
type LineKind int
LineKind classifies a physical line of a dotenv file.
const ( // KindBlank is an empty line or one containing only whitespace. KindBlank LineKind = iota // KindComment is a line whose first non-whitespace byte is '#'. KindComment // KindKeyVal is a well-formed KEY=VALUE line. KindKeyVal // KindOther is any non-blank, non-comment line without an '='. KindOther )
Click to show internal directories.
Click to hide internal directories.