dotenv

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 4 Imported by: 0

README

Dotenv

Small .env file loader.

Usage

err := dotenv.LoadFile(dotenv.Options{})

All options

err := dotenv.LoadFile(dotenv.Options{
  FilePath: ".env",
  Overwrite: false,
})

File format

# A comment
KEY1=value 1
KEY2=value 2

Documentation

Overview

.env file loader.

Version: 0.0.1. Repository: https://github.com/ordinary-dev/go-sfl. License: MIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFile

func LoadFile(opts Options) error

Load .env file.

Usage:

err := dotenv.LoadFile(dotenv.Options{})

All options:

err := dotenv.LoadFile(dotenv.Options{
	FilePath: ".env",
	Overwrite: false,
})

File format:

# A comment
KEY1=value 1
KEY2=value 2

Types

type Options

type Options struct {
	FilePath  string // Path to the .env file, default: ".env".
	Overwrite bool   // Overwrite existing variables? Default: false.
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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