Skip to content

facktoreal/env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Env loader

.env file loader

Usage

Current release version of backend. Can be set in CI/CD using:

package main

import "github.com/facktoreal/env"

func main()  {
	// envOptional bool
    if err := env.Init(true); err != nil {
        // handle error
    }
     
    // string or ""
    env.MayGetString("ENV_STRING_VAR")
    
    // string or panic
    env.MustGetString("ENV_STRING_VAR")
    
    // int or panic
    env.MustGetInt("ENV_INT")
    
    // must exist and not empty or panic
    env.MustPresent("ENV_BOOL")
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages