dotenv

package
v1.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package dotenv parses .env-style KEY=VALUE text into ordered pairs, for bulk importing application and stack environment variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

KeyValue is one parsed environment entry.

func Parse

func Parse(content string) []KeyValue

Parse reads .env-style content and returns the variables in file order. It skips blank lines and # comments, tolerates an optional `export ` prefix, and strips matching single or double quotes around values. Duplicate keys are returned in order for the caller to resolve. Lines without an `=` or with an empty key are ignored.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL