Skip to content

A small helper library for reading values from environment variables

License

Notifications You must be signed in to change notification settings

bored-engineer/env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang Environment Variables Go Reference

A small Golang package for parsing values from environment variables based on github.com/spf13/cast.

Usage

This package was originally written for use in simple AWS Lambda functions to reduce boilerplate, ex:

package main

import (
    "fmt"
    "context"

    "github.com/aws/aws-lambda-go/lambda"
    "github.com/bored-engineer/env"
)

var FunctionName = env.String("AWS_LAMBDA_FUNCTION_NAME")

func invoke(ctx context.Context) {
    fmt.Printf("Hello from %s", FunctionName)
}

func main() {
    lambda.Start(invoke)
}

About

A small helper library for reading values from environment variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages