Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse reads .env content into a key-value map. content is the raw file content; returns parsed key/value pairs or an error.
func Patch ¶
Patch updates .env content with the provided key/value pairs. content is the existing file content; updates supplies key/value pairs to merge. New keys are appended in sorted order and leave the result ending in a newline, so a later shell append cannot merge onto the last value; otherwise the input's final-newline state is kept.
Types ¶
type Assignment ¶ added in v0.24.1
type Assignment struct {
// Export reports whether the line starts with "export ".
Export bool
Key string
// Value is the decoded value.
Value string
// Comment is the raw trailing comment after a quoted value, including its
// leading whitespace; it is empty when the value is unquoted or has no comment.
Comment string
}
Assignment is one KEY=value line of .env content.
Click to show internal directories.
Click to hide internal directories.