Skip to content
/ goenv Public

A lightweight Go package that loads environment variables from an .env file.

License

Notifications You must be signed in to change notification settings

raiesbo/goenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go env

A lightweight Go package that loads environment variables from an .env file, which can be located anywhere within the project's structure.

This package has no external dependencies.

Install

go get github.com/raiesbo/goenv

Examples

As easy as:

package main

import (
	"goenv"
)

func main() {
    if err := goenv.Load(); err != nil {
        panic(err)
    }
    
    // After loading, the environment variables are ready to be used. 
    // Example: addr := os.Getenv("ADDR")
}

About

A lightweight Go package that loads environment variables from an .env file.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages