Skip to content

A simple environment variable (env) file loader for go specific projects

License

Notifications You must be signed in to change notification settings

ajsqr/goenvloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An easy to use library to load env variables for go projects

goenvloader lets you load your project specific environment variables using just a method call.

Installation

  1. Initialize a go module.
go mod init example.com/package
  1. Install goenvloader
go get github.com/ajsqr/goenvloader

Example

example env file

DATABASE=POSTGRES
PASSWORD=PASSWORD #This is a comment

example go code to load the .env file

package main

import "github.com/ajsqr/goenvloader"

func main(){
    loader := goenvloader.NewLoader(".env") // The env file name
    loader.Load()
}

About

A simple environment variable (env) file loader for go specific projects

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages