# README
Welcome to expand š
Expands variables recursivly using a dependency graph algorithm
š Homepage
Install
go get github.com/alex-held/expand
Usage
func main() {
vars := map[string]string{
"a": "$HOME/$b/$c",
"b": "$c/foo",
"c": "bar",
"HOME": "/home/user" // override environment variable
}
expansions, err := expand.Expand(vars)
if err != nil {
panic(err)
}
println(expansions.MustGet("a"))
// Outputs:
// /home/user/bar/foo/bar
}
Run tests
go test -v ./...
Author
š¤ Alexander Held
- Website: https://alexheld.io
- Twitter: @0_alexheld
- Github: @alex-held
Show your support
Give a āļø if this project helped you!