dotenv

package
v0.5.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: PostgreSQL Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dotenv sets one variable in a .env file, leaving every other line as it was.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(path, name, value string) error

Set writes name=value into path. The last line assigning name is replaced, since the last assignment is the one every loader keeps; with none, the line is appended. A new file is created at 0600, and an existing file keeps its mode. A symbolic link is refused: the file receives a live password, and a planted link would send it elsewhere.

func ValidName

func ValidName(name string) bool

ValidName reports whether name can be a variable in a .env file.

func WarnIfCommittable

func WarnIfCommittable(rt *module.Runtime, path string)

WarnIfCommittable warns on stderr when git tracks path, or would commit it because it is not ignored. Ignoring a tracked file alone keeps committing it, so that case also names git rm --cached.

Types

This section is empty.

Jump to

Keyboard shortcuts

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