dotnev

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

向os ENV提供加载.env数据

Index

Constants

This section is empty.

Variables

View Source
var DefaultName = ".env"

DefaultName default file name

View Source
var OnlyLoadExists bool

OnlyLoadExists load on file exists

Functions

func Get

func Get(name string, defVal ...string) (val string)

Get get os ENV value by name

func Load

func Load(dir string, filenames ...string) (err error)

Load parse .env file data to os ENV. Usage:

dotenv.Load("./", ".env")

func LoadExists

func LoadExists(dir string, filenames ...string) error

LoadExists load on file exists

func LoadFromMap

func LoadFromMap(kv map[string]string) (err error)

LoadFromMap load data from given string map

Types

This section is empty.

Jump to

Keyboard shortcuts

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