slackdotenv

package
v0.0.0-...-5ee9e10 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package slackdotenv reads and parses .env files from a project directory.

It provides a single entry point for loading environment variables defined in a .env file so that multiple packages (commands, config, hooks) can share the same parsing behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(fs afero.Fs) (map[string]string, error)

Read parses a .env file from the working directory using the provided filesystem. It returns nil if the filesystem is nil or the file does not exist.

func Set

func Set(fs afero.Fs, name string, value string) error

Set sets a single environment variable in the .env file, preserving comments, blank lines, and other formatting. If the key already exists its value is replaced in-place. Otherwise the entry is appended. The file is created if it does not exist.

func Unset

func Unset(fs afero.Fs, name string) error

Unset removes a single environment variable from the .env file, preserving comments, blank lines, and other formatting. If the file does not exist or the key is not found, no action is taken.

Types

This section is empty.

Jump to

Keyboard shortcuts

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