Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rosylilly/env


https://github.com/rosylilly/env

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

        

# github.com/rosylilly/env

env provides utility methods for environment variables.

## Example

```go
package main

import (
"log"

"github.com/rosylilly/env"
)

type JSONValue struct {
A string `json:"a"`
B int `json:"b"`
}

func main() {
strVal := env.String("FOO", "default value")
log.Println(strVal)

intVal := env.Int("BAR", 100)
log.Println(intVal)

jsonVal := env.JSON("BAZ", JSONValue{})
log.Println(jsonVal)
}
```