Documentation
¶
Overview ¶
Package envfile reads files of environment variables, one NAME=value a line, as the .env files many tools keep beside a project.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Var ¶
Var is a variable a file sets.
func Parse ¶
Parse reads variables from r, in the order they are written:
# a comment NAME=value export NAME=value NAME="a value with spaces, \n for a newline and \" for a quote" NAME='a value taken as it is, $ and \ included' NAME=value # a comment after a value that is not quoted
A value that is not quoted has the spaces around it removed. A value in double quotes may go on over several lines. Nothing is expanded: $OTHER in a value is those characters. A name written twice is returned twice, for the last to win.
An error starts with the line it is about, as "3: ...".
Click to show internal directories.
Click to hide internal directories.