A small Golang package for parsing values from environment variables based on github.com/spf13/cast.
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)
}